0

Here, I put a custom magento "Storelocator" module, however I noticed that the tags "meta" was already preset in the source code of the page.

I just wanted that on this page there are other independent meta tag. head.phtml and the default file.

I surfed the web to find a solution is I stumbled upon this page : https://stackoverflow.com/questions/24373670/how-to-rewrite-head-phtml-in-magento

For cons, I want to put meta tags directly into the page storelocator.phtml.

So how to disable the Head.phtml in Storelocator page?

Thank you for your help.

  • Storelocator is a paid module, I suggest you see this directly with the vendor if no one was to answer your question, thank you. – Julien Lachal Jul 29 '14 at 8:50
1

This is not an answer to your question, but it may be a solution to your problem.
You don't need to disable the head.phtml in your custom module pages. There might be useful information in there that you would want in your pages.
In order to change the meta data you can do this.

If the meta values are always the same you can use the layout xml.

<page_handle_here><!-- your page handle module_controller_action -->
    <reference name="head">
        <action method="setTitle" translate="title"><title>Your meta title here</title></action>
        <action method="setKeywords" translate="keywords"><keywords>Your meta keywords here</keywords></action>
        <action method="setDescription" translate="description"><description>Your meta description here</description></action>
    </reference>
</page_handle_here>

If your values are dynamic you can use this in the action of your page after calling loadLayout

$head = $this->getLayout()->getBlock('head');
if ($head) {
    $head->setTitle('your title here');
    $head->setDescription('your description here');
    $head->setKeywords('your keywords here');
}
  • Method 2 does not work, it always takes me to the meta head.phtml default. In the back office, there is the Storelocator module or can I change the title of the page but I do not do little more ... – user3406794 Jul 30 '14 at 7:23
  • <action method="setTitle" translate="title"><title>TEXTE A </title></action> <action method="setKeywords" translate="keywords"><keywords>TEXTE B</keywords></action> <action method="setDescription" translate="description"><description>TEXTE C </description></action> – user3406794 Aug 1 '14 at 7:35
  • thanks, Solution 2 running, I forget to empty the cache magento ... – user3406794 Aug 1 '14 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.