Hi,
I am switching to ModX but one thing I am not clear about is how to control snippet/chunk display. Let me explain this.
Say I am creating a 10 page site. Further say I am displaying 2 chunks, say chunk 1 on page 1, 2 and 4; chunk 2 on page 2, 5,7. Here chunk 1 and 2 both are displayed on page 2. How can I control which chunk will display on what pages?
I need this for both chunks as well as snippets.
What I am looking for is something similar to how in Joomla we can decide where a module will show.
I know one way is to have a different template. However for a 300 page site and for 20 modules which may overlap with various combinations, this is not practical.
There must be another way to do this that I haven’t figured out. Please suggest.
- Amit
-
☆ A M B ☆
- 24,524 Posts
Use TVs. You can either just put the chunk tags in the TV, or use @CHUNK binding. I have a tutorial on making a TV provide a set of check boxes for specifying which chunks to put on a resource being edited.
http://www.sottwell.com/how-template-variables-work.html
How?
Do I create a TV for every chunk I want, then in the TV I specify the ID’s for pages the chunk will display in? I can’t put any logic in a chunk, then this won’t work.
I am not super familiar with chunk binding so maybe I am confused. I am specifying chunk bindings then won’t I need to modify each page when I need to change the pages where that chunk is supposed to show. For example in my scenario if I need to change chunk 2 to show in page 2, 8 and 9, then won’t I need to change all the 3 pages (actually 2) plus the pages where I remove this from?
Or am I confused?
I was more looking at a central place to control the display much like Joomla Modules.
Thanks
Amit
-
☆ A M B ☆
- 24,524 Posts
No. Create one TV with an input type of check box. Each check box will indicate whether or not to use the chunk it is associated with. The article I linked to walks you through creating such a TV.
-
☆ A M B ☆
- 24,524 Posts