I think a good way to do this would be to use an @chunk binding.
- Create a new TV
- Choose a variable name and caption for your TV
- Input Type: [tt]Check Box[/tt]
- Input Option Values: [tt]Chunk One == @CHUNK chunk1 || Chunk Two == @CHUNK chunk2[/tt] where [tt]chunk1[/tt] and [tt]chunk2[/tt] are the names of your chunks
- Assign the TV to the templates that require it.
- Create your chunks if you have not already.
- Put the TV call in your template (For example [tt][*chunktv*][/tt])
You should now have two nifty check box options on the edit pages using the above template.
I am not sure the technical advantages to this method over just calling the chunk name (i.e. [tt]{{chunk1}}[/tt]) directly but it seems like it would cut out at least one cycle of reference. Any comments?
Quote from: ProWebscape at Mar 22, 2007, 10:27 PM
How would you do this with "inheritance"? So if you check the box in the parent document, it will show in all of the child documents, unless you uncheck it?
For inheritance, use the @INHERIT binding:
http://www.modxcms.com/inherit-binding.html
To add Inheritance you can set a
Default Value of:
[tt]@INHERIT @CHUNK chunk3[/tt]
This will set the default value of the TV to the contents of chunk3 if no check box has been selected on the document or its parents documents.
The nice thing about this setup is that chunk3 shows up when no check boxes are selected. If you want to return to the default chunk, just clear the check boxes.
Of course, you can mix and match these bindings for a huge amount of options. For example, one check box could bring in a chunk, another text from a file and the third, database data.