Home » Magento

Magento: Set title, keywords and description in your module

4 February 2010 3,968 views Popularity: 8% Share/Bookmark

email

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 ;)

Related posts:

  1. Magento: Set/Change page layout, title tag, meta keywords and description
  2. Magento: How to change default page layout?
  3. Dynamically change page title and meta tags in C#
  4. Magento: Access denied in admin of custom module
  5. Magento: How to get controller, module, action and router name?
  6. What are Meta-Tags? Full Description of Meta tags
  7. Magento: How to change or reorder top links?
  8. Magento: Read Write XML
  9. Magento: Upgrading mysql setup of a module
  10. Magento: Read config XML nodes
  • http://www.easytrafficstepsplus.com/136812/title-keywords-and-description/ Title, keywords and description? | Easy Traffic Steps Plus

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

  • http://www.creative-web-media.com/ positionnement web

    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…

  • Samir Amrutya

    Hi,

    How can i give store view wise page title for all pages. Can I give in mymodule.xml ??

    I want to give page title from language file(.csv file for all languages).