Where and how to set titles in custom module?
I got a custom (but close to standard) news module with router,controller,etc … and want to set title for single news view dynamically.
Please let me know if you need any files.
magento-1module
Where and how to set titles in custom module?
I got a custom (but close to standard) news module with router,controller,etc … and want to set title for single news view dynamically.
Please let me know if you need any files.
Best Answer
You can the page title using ->setTitle();
For example my page title is My title; the add below code in between
$this->loadLayout();
and$this->renderLayout();
in controller action, and just change title accordingaction or it action parameters
I,eAdd the code in Controller
Example: same action but different parrmeters
then in
MymoduleContoller.php
at actionmyindexAction
code is like$this->renderLayout();
If want using xml then try below
http://blog.chapagain.com.np/magento-setchange-page-layout-title-tag-meta-keywords-and-description/ http://inchoo.net/ecommerce/magento/change-any-page-title-in-magento/