We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 598
    • 27 Posts
    Hi,

    I would like to know if what I’m trying to do is logical and if it is, how to achieve it :

    I have a news page managed by Ditto, that summarizes news coming from 10 different folder’s subfolders, organized this way (all folders are at the root of the site) :

    city1
    >news folder
    >>post 1
    >>post 2
    >>post ...

    city2
    >news folder
    >>post 1
    >>...

    city...

    I want the name of each city folder, its page title, to show automatically on the top of each post info in the Ditto listing. I have tried to use the ultimate parent snippet in the chunk used to style Ditto, but I can only get the ultimate parent page’s id and not the page title.

    What to do ?!
    Thanks.

      "Puisque ces myst
      • 26178
      • 32 Posts
      If you have id of the ultimate parent, you can use GetField snippet (http://modxcms.com/getField-667.html) to fetch the pagetitle field.
        • 598
        • 27 Posts
        Thanks I’m going to check that.
          "Puisque ces myst
          • 598
          • 27 Posts
          Struggling a little bit... Do you mean I should use GetField in addition to the ultimateParent snippet ? By reading the directions it seems that GetField can do that by itself.
          It does output a page title though.
            "Puisque ces myst
            • 26178
            • 32 Posts
            Yeah, you are right, you don’t need UlimateParent. Should just work like this: [[GetField? &field=`pagetitle` &parent=`1`]]
              • 598
              • 27 Posts
              Hourrah ! Done it. The missing bit was setting the proper docid. It works with :
              [[GetField? &docid=`[+id+]`&parent=`1`]].
              Thanks a lot.
                "Puisque ces myst