We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21106
    • 53 Posts
    Good day, guys. I'm can't think of a better way to phrase the question. But here's an overview of what I wanted.

    I'm working on a site with the following structure:

    Lessons
    - Grammar
    - Lesson 1
    - Lesson 2
    - Lesson N
    - Composition
    - Lesson 1
    - Lesson 2
    - Lesson N
    - Vocabulary
    - Lesson 1
    - Lesson 2
    - Lesson N
    - Accent
    - Lesson 1
    - Lesson 2
    - Lesson N

    Q & A
    - Word Usage
    - Q & A 1
    - Q & A 2
    - Q & A N
    - Difference Between
    - Q & A 1
    - Q & A 2
    - Q & A N


    Now on the homepage, I want to display the latest lessons using getResources. For usability, the plan was to assign specific colors to each article, depending on its main container (Lesson or Q&A). To accomplish this, I plan on outputing a CSS class for each snippet of the article that will be on the homepage. I've looked through getResources' rtfm but I can't find such way to show the connection between the article and the main container. Any idea guys?

    Help will be much appreciated. Thanks!
      • 4172
      • 5,888 Posts
      you can get the parent-id of each Resource with

      [[+parent]]


      if you need the id of the ultimateParent you can use the ultimateParent-snippet in your getResources-tpl

      if the id is not enough, you can combine this with the getResourceField-snippet to get any field of the parent/ultimateparent
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 21106
        • 53 Posts
        Quote from: Bruno17 at Aug 21, 2012, 02:04 AM
        you can get the parent-id of each Resource with

        [[+parent]]


        if you need the id of the ultimateParent you can use the ultimateParent-snippet in your getResources-tpl

        if the id is not enough, you can combine this with the getResourceField-snippet to get any field of the parent/ultimateparent

        Thank you!

        Let me try this.