Sorry if it a stupid question but...
I’m learning Ditto the hard way. I wanted to make a sort of portfolio with it. And here’s how i did it :
1. create TV’s for custom fields (image, utl, buttons, icons,..)
2. create a chunk for custom ditto template
3. there i was pretty lost and i tried different things. Finally created a new template page blank with my tv’s associated.
4. I created a folder with many pages with that template.
5. i called Ditto on my parent and it worked apparently.
First as i’m no pretty sure of what i’m doing...did i do everything the right way ?
And my second and real stupid question : now that i have a lot of different pasges with my portfolio item in it if i unpublish it of course Ditto don’t see it but if i do then i can browse that page...and it’s empty of course. It’s not a big deal but is there a way to make that page not browsable if i’m clear on that.
Thank’s for your help and answers.
Chris
ok thanks. Seems easy. For the way i used Ditto, was it the right way though ? I couldn’t find any kind of answers on how to do what i wanted.
Ok then. Thank you for your help.
Euh well actually i have another question. I just tried to look for answers but i didn’t.
I have 3 different folders with my documents in them and i’d like on my homepage to call Ditto and take randomly 1 of each folder. i understood that i can randomize my results but is there a way i can take 1 result from 3 different folder ?
-
MODX Staff
- 12,272 Posts
As with most things-modx, there’s typically a ton of ways to get to the same end results. Use what works best for you!
I’m not sure Ditto can pull 1 per container. You’ll probably need to fudge it and make 3 calls.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
You could always simply use 3 Ditto calls, one for each folder. However 2 Ditto instances to return 2 results is a bit of an overkill (but will work and is easy to setup).
Or you could use some code (php) to pic one random item from each container and create a dynamic list to be used with the &documents parameter in ditto.
Good to know it works. I am always amazed at how great Ditto is.