Home » Magento

Magento: Set title, keywords and description in your module

4 February 2010 970 views 2 Comments Popularity: 11% Share/Bookmark

Suppose, you have created a new module or you have an existing module. You have a frontend page for your module. You want to set or change title, keywords, and/or description of your module page. Well, you can do so by adding few lines of code in layout xml file of your module.

The layout file for you module is present in design/frontend/default/default/layout/YourModuleName.xml. I suppose that you are using default theme and package. The default/default/ in the above path might be different if you are using custom theme and package.

Now, open the layout xml file of your module. You must see the node named default. Write the following code inside the default node.

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

You can set title, keywords, description for specific page of your module as well. Suppose, you have an address page for you module. The address page will have the node named something like YourModule_index_address. You can copy and paste the above xml code inside this node and change the value of title, keywords, and description. Now, the address page of your module will have different title, keywords, and description.

This is really helpful for Search Engine Optimization in Magento.

Happy SEOing in Magento ;)

From Mukesh Chapagain's Blog | Post Magento: Set title, keywords and description in your module

Related posts:

  1. Magento: Set/Change page layout, title tag, meta keywords and description
  2. Magento: Access denied in admin of custom module
  3. Magento: How to get controller, action and module name in template file?
  4. Magento: How to change or reorder top links?
  5. Dynamically change page title and meta tags in C#

2 Comments »

  • Title, keywords and description? | Easy Traffic Steps Plus said:

    [...] Magento: Set title, keywords and description in your module … Share and Enjoy: [...]

  • positionnement web said:

    positionnement web…

    When creating your site copy, just write naturally, explaining whatever information you’re discussing. The key is to make it relevant, and to have it make sense to the reader. Even if you trick the search engines into thinking your page is great — when…

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.