We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36446
    • 184 Posts
    Hi!
    I have a menu structure like this

    .Folder1
    --Subdfolder1
    ...Item1
    ...Item2
    --Subfolder2
    ...Item3
    ...Item4
    ...
    Folder2
    --Subfolder3
    ...Item4

    I use get ressources to get a list of all childer from one folder.
    Now i want to add a class name to my output so that the subfoldername is part of my output

    Like this:
    <li class="subfolder1">Content of item 1 </li>
    <li class="subfolder2">Content of item 3</li>

    and so on... Is there an easy way on how to get the subfoldername (or the id) of my (parent)menu structure in getressources?



    This question has been answered by flanger. See the first response.

      https://www.beautyislife-shop.de - premium make-up!
      https://www.topsterne.de - sell it here!
      ---------------------------------------------------------
    • discuss.answer
      • 36446
      • 184 Posts
      love it! Modx is just great! I could use the getRessourceField snippet for this...
      Here is my getressource chunk

      <li class="[[getResourceField? &id=`[[+parent]]`]] shadow ui-state-default">
      <a target="_blank" href="[[+tv.affiliatecode]]"><img src="[[+tv.affiliateimg]]"></a>
      </li>
        https://www.beautyislife-shop.de - premium make-up!
        https://www.topsterne.de - sell it here!
        ---------------------------------------------------------