I think what you’re trying to do is create relationships between documents rather than templates. I wrote a snippet called Related last year that handles this in a variety of ways.
For your requirement you would need to:
* Create folders in the site tree with your two sets of items, eg ’Expertise’ and ’People’
* Create a ’person’ template and an ’expertise’ template
* Fill the ’Expertise’ folder and the ’People’ folder with documents based on the appropriate template
* Create a new TV called ’expertise’:
- Input Type: use Check Box (can also be DropDown List Menu or Listbox)
- Input Option Values: @EVAL return $modx->runSnippet(’Related’, array("parents"=>"4");
(replace the ’4’ with the actual document id of the ’Expertise’ folder)
- Assign the TV to the People template
* Now you will have a checkbox for each expertise on pages based on the ’Person’ template
There is also another snippet called Quill that does much the same thing, and will also allow you to output select menus within your web pages as well. (In fact i would recommend it over my own snippet unless your relationships are many-to-many).
http://modxcms.com/extras/package/?package=372
http://modxcms.com/extras/package/?package=355
To display your relationships you can use Ditto’s tag parameters, eg to output a list of people with a particular expertise on the expertise page put this in your expertise template:
[!Ditto? &parents=`40` &depth=`1` &display=`all` &tagData=`expertise` &tagMode=`onlyTags` &tagDelimiter=`,` &tags=`[*id*]` &sortBy=`pagetitle` &sortDir=`ASC`!]
(where 40 is the docid of the People container)
To do the reverse and output the expertise assigned to an individual on the person’s page you can use Ditto again in the person template:
[!Ditto? &documents=`[*expertise*]` &depth=`1` &display=`all` &sortBy=`pagetitle` &sortDir=`ASC`!]