We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30244
    • 4 Posts
    [Original Topic title: Can I use getResourceField to display pagetitle for parent of parent resource?]

    I would like to know how to call/write a snippet in my template that will display the pagetitle for the parent of a parent resource. E.g. I want the title in the right-hand column of this page: http://www.elbafirst.co.uk/index.php?id=32 to say "Other Hotels in Marciana"

    The Resources structure is (as displayed by the Breadcrumbs snippet in the front-end):

    Resorts >
    Marciana >
    Accommodation >
    Hotel Désirée

    Thanks in advance.
      • 33968
      • 863 Posts
      You could do that using UltimateParent which will travel up the resource tree until it hits a certain level (in this case 2), then return the id of that resource.

      Combine it with getResourceField to grab the pagetitle:
      [[getResourceField? &id=`[[UltimateParent? &topLevel=`2`]]` &field=`pagetitle`]]
      
        • 30244
        • 4 Posts
        Thanks lucas. Your solution works and is so simple! Didn’t know you could put a snippet call inside a snippet call either. smiley