Login  Register

Re: Duplicate title tags and meta descriptions

Posted by Hugo <Nabble> on Oct 22, 2011; 5:26am
URL: https://support.nabble.com/Duplicate-title-tags-and-meta-descriptions-tp6759630p6919443.html

Mark, below is a sample code that should work for you. Here is the explanation: for each app title you want to customize you have to create a "n.case" block that prints the title of that app. I've create the cases for "The Woodstove" and "Summer Sports" below, so now you can follow that idea and add new cases for the other forums. Please try that code and let us know what should be the next step (maybe the post titles?). Questions?

<override_macro name="app_title">
  <title><n.compress.>
    
    <n.switch. value="[n.page_node.subject/]">
      
      <n.case. value="The Woodstove">
        <n.custom_title page1="The Woodstove: Skiing, Snow, Mountains" pageN="The Woodstove: Page #"/>
      </n.case.>
      
      <n.case. value="Summer Sports">
        <n.custom_title page1="Summer Sports: Hiking, Camping, Paddling, Biking" pageN="Summer Sports: Page #"/>
      </n.case.>
      
      <n.default_case.>
        <n.page_node.app_title_contents/>
        <n.page_node.app_title_ending/>
      </n.default_case.>
      
    </n.switch.>    
    
    </n.compress.></title>
</override_macro>


<macro name="custom_title" parameters="page1, pageN">
  NY Ski Forums |
  <n.if.equal value1="[n.app_page_number/]" value2="1">
    <then.page1/>
    <else>
      <n.regex_replace_all. pattern="#" replacement="[n.app_page_number/]">
        <n.pageN/>
      </n.regex_replace_all.>
    </else>
  </n.if.equal>
  | Harvey Road 
</macro>