We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6561
    • 139 Posts
    I’m calling UltimateParent snippet in my template, so that I can have a custom header depending on which language folder the page is in (one folder ’english’, one folder ’dutch’ etc. with all pages below those).

    However I need a unique number, not the page same, so that I can make a call a bit like this:

    <img src="[(base_url)]assets/templates/mytemplate/images/header[~[[UltimateParent]]~].gif" /> 


    And it would output this:

    1. For English (menuindex 1 or other unique number):
    <img src="assets/templates/mytemplate/images/header1.gif" />


    2. For Dutch (menuindex 2 or other unique number):
    <img src="assets/templates/mytemplate/images/header2.gif" /> 


    Like I said, the call gives me a page name, but not a unique number (or string) which I could use to change the header to reflect the page’s language.

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      The UltimateParent snippet only returns the document ID, which is of course a unique number. If you don’t enclose it in the [~...~] tags you won’t get the document ID converted into the alias/page name.

      <img src="[(base_url)]assets/templates/mytemplate/images/header[[UltimateParent]].gif" /> 
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 6561
        • 139 Posts
        Quote from: sottwell at Mar 27, 2009, 07:08 PM

        The UltimateParent snippet only returns the document ID, which is of course a unique number. If you don’t enclose it in the [~...~] tags you won’t get the document ID converted into the alias/page name.

        <img src="[(base_url)]assets/templates/mytemplate/images/header[[UltimateParent]].gif" /> 


        Oops! Yes, that did the trick! smiley Even though I’ve been using Modx for a while now, there are still a lot of things that need to ’sink in’.

        Oh - and I appreciate you helping me out this late at night cool