Set title, Keywords And Description In Your Custom Module In Magento



Suppose you have developed an Extension and there is a frontend page for your extension and you want to set or change title, keywords, and/or description of your custom extension front page. Here in this post I am describing how to set all these it can be done by adding few lines of code in layout xml file of your custom extension.

Step 1. Navigate to the layout file for your custom extension which is presented in design/frontend/default/default/layout/YourCustomextensionName.xml. The default/default/ in the above path might be different if you are using custom theme and package.

Step 2. Open the layout xml file of your extension in the editor of your choice. You must see the node named default. Insert the following code inside the default node.

<reference name="head">
    <action method="setTitle"><title>Your Extension Page Title</title></action>
    <action method="setKeywords"><title>your, extension, keywords</title></action>
    <action method="setDescription"><title>Your Extension Description</title></action>
</reference>

Step 3. Now Clear the browser cache as well as the Magento cache through the admin panel.

You can set title, keywords, description for specific page of your extension as well by using the same code above. You have done.

Enjoy the Magento coding.