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

    Here’s what I am trying to do.

    I have 3 folders.

    One named experts, contains a list of documents, each representing an expert.

    Then another folder named topics, which contains individual topics, which then further contain a number of documents representing opinions on that particlar topic.

    Using the Related snippet I can build a relationship between an opinion and an expert, which is saying, person X has this opinion about this topic.

    To add to that, each expert has their own homepage of sorts which (using ditto) lists out all of their opinions.

    I have attached a screen-shot of the document tree. Hopefully that will make more sense! laugh


    I can get ditto to list out the opinions for each expert but I am having difficulty getting the pagetitle of the parent of the opinion article (the topic).

    In my Ditto template I am running a snippet which contains the getParent function. It will grab the pagetitle of the parent of the page wherever the ditto snippet is called from. So when I call it from the expert homepage (let’s say Expert 02) then it returns ’Experts’.

    This is fine, but is there any way to get Ditto to grab the parent id, pagetitle, etc from a specific ditto item that was generated?

    Thanks a lot for any help. smiley
      • 20413
      • 2,877 Posts
      I haven’t used http://www.modxcms.com/forums/index.php?topic=26494
      But maybe GetField and UltimateParent snippets can help you out?
        @hawproductions | http://mrhaw.com/

        Infograph: MODX Advanced Install in 7 steps:
        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
        • 10638
        • 57 Posts
        Brilliant. Thank you for that mrhaw. grin

        And for anyone that may stumble across this post in the future:

        Using the GetField snippet I was easily able to get the topic pagetitle using the following within the Ditto &tpl.

        Topic: [[GetField?docid=`[+parent+]` &field=`pagetitle`]]
        


        Thanks again!