Thanks Bob and Dave for your advice. It gave me the opportunity to learn a new
way to use TV’s by making drop down’s. In the end I choose to use a list box
to make all the selections visible. I dropped the PHx snippet idea.
@Bob: I read your blog regularly for Modx tips!
I liked your dynamic solution but I wasn’t sure how it
resolved the problem of finding the parent ID when the resource page is the parent.
Could you explain that a bit? The client needs to beable to control the text in the
h2 and I need to be able to control the class assigned to the h2.
So based on your suggestions the solution looks like:
1. In the template I have all the TV’s in a chunk. for
cleaner code.
like so:
2. and all of my TV in the chunk
<div id="sidebar">
[*side_Feature*]
[*side_Feature_Img*]
[*side_Caption*]
<!-- and a few more TV’s here etc.--->
</div>
I changed that Chunk to:
<div id="sidebar">
<h2 class=[*section*]>[*side_Feature*]</h2>
[*side_Feature_Img*]
<h4 class=[*section*]>[*side_Caption*]</h4>
<!-- and a few more TV's here etc.--->
</div>
3.created Tv called [*section*]
Created a list box in the TV called [*section*]
4. choose the appropriate colour from the listbox in the resource page.
This solves the problem. It leaves the choice of the
colours in the hands of the client and I was hoping to avoid that.
Perhaps as I learn more I’ll be able to change that.
thank you,
Lisa