Thanks TobyL.
Have a great holiday.
Terry
www.terrybarthdesign.com
TobyL
Thank You for taking a look. I used the new snippet code. No change.
I’ve been testing this on my wamp server. Since I still couldn’t get it work with the new snippet, I thought perhaps I missed a step. So started from scratch, this time on my server site. No change.
I feel silly about this, it seems so straight forward. . . Can I pm you access to my site for a closer look?
Terry
www.terrybarthdesign.com
Yep,.. PM me and I’ll have a quick look..
All fixed.
In a nutt shell:
1. typo in my code posted above where I accidentally introduced a space in $modx->[space]getTemplateVarOutput (corrected original posts)
2. The TV should have had a "Delimited list" widget assigned with a comma as separator.
3. Your TV was called includesDocs while the snippet tries to get output from includeDocs
4. My short term memory is failing... don’t remember what the fourth issue was.
I’ve left some debug code in the snippet (commented out). Feel free to remove.
TobyL
Fantastic!! Thank you! Works like a charm.
If I could indulge one more time. I don’t quite understand one thing.
It appears that the document selection is done on the container doc, which then displays the selected content on the parent to that container document?
Is this correct?
Web Page (selected docs appears here)
Container Doc (make selection here)
Doc 1
Doc 2
Doc 3
I had assumed that the selection would be made on the actual document where I want the output to appear using the TV on that document. It took me a while to figure this out. After you fixed up my page, I was trying to make some selections on the web page, but it didn’t work until I realized I was selecting the docs on the wrong page.
My plan was to use this to select sidebar content from a central container for a variety of pages through a site. The idea was to have a set of content documents in one folder (created by the non technical owner of the site as they need them), then give them the ability to select that content on various pages in the sidebar as appropriate using the TV for each page. Some content would be used on multiple pages.
If the selected documents are output only to the parent of the container, then the content would not be available to other pages on the site.
Is that correct?
www.terrybarthdesign.com
Ok, I’ve sorted this out.
This snippet is working perfectly and it does work in the way I had expected.
It turns out the alias on the parent document was pointing to the container document. Consequently I wasn’t really seeing the parent document but instead I was seeing selections made on the container doc.
So I’m good to go! My clients are going to love this!
Thank you.
www.terrybarthdesign.com
I was glad to find this - got it working after a bit of trial and error, so thanks very much for posting this great solution to a problem.
I thought I might mention to any people discovering this snippet for the first time that if you copy and paste the final example of the snippet, you might want to change the publish parameter in the getDocuments call from 0 to 1, in order to save yourself the trouble of smacking yourself in the head when you realise that is why the snippet wasn't picking up your published documents.