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

    I have a page on my site called 'people'.
    This includes an image, name, and title for each employee.
    Each employee also belongs to a team (customer services, sales etc).
    So I've created a collection for people, and have output them as list items within a <ul> - all great - but I want to have a separator <li> to show the name of their team (e.g. customer services).
    I am thinking of having a collection for each team - but is there a simpler way?

    Thanks as always!
    Andy

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

      • 4172
      • 5,888 Posts
      I would put them into a custom-table with a second team-table and would relate them to each other.

      But in your case, with Resources, you could use Tagger to categorise them.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
      • discuss.answer
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        I use different pdoResources snippets for each group, filtering on their team TV.
        <ul>
        <li><h3>Team One</h3>
        [[pdoResources? 
          &parents=`56`
          &limit=`0`
          &tpl=`teamTpl`
          &includeTVs=`team,photo`
          &where=`{"TVteam.value":"team1"}`
        ]
        <li><h3>Team Two</h3></li>
        [[pdoResources? 
          &parents=`56`
          &limit=`0`
          &tpl=`teamTpl`
          &includeTVs=`team,photo`
          &where=`{"TVteam.value":"team2"}`
        ]
        ...
        </ul>
         
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          You could generate the list of teams, and have their tpls contain the individual pdoResources snippets, but I prefer to keep things as simple and transparent as possible.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 51020
            • 670 Posts
            Thanks all - I have tried by using nested collections - one for each team, and then calling them one by on e- seems to work OK.


              • 28042 ☆ A M B ☆
              • 24,524 Posts
              That's the greatness of MODX. Always more than one way to do things!
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 40833
                • 52 Posts
                I want to second Bruno’s suggestion of using Tagger with Collections. It works pretty seamlessly and provides an easy interface for clients. It also uses friendly urls to allow further refinement in how you show groups.

                In fact, I just wrote a tutorial on how to add a column to the Collections list that shows the tags for each item:
                https://forums.modx.com/thread/98747/howto-add-tagger-column-to-collections-list#dis-post-533990