I use the fileInclude snippet for my templates. Today I wanted to use TV’s for just one section of site. But the design stays the same.
So I created a new template, and included the original template file. Then added the new TV’s just for this template.
The great part about it is there is no duplication of HTML or copy/paste. When I need to make a change to the design, I only have to do it in one place!
Would this work for more complex layouts where you’d be adding a second or third column? Or would it only be appropriate where you want to add some additional items in the columns for example?
Ryan Thrash, MODX Co-Founder Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
Would this work for more complex layouts where you’d be adding a second or third column? Or would it only be appropriate where you want to add some additional items in the columns for example?
Well for my purposes, this is for a blog. So I did this to have the Tags TV only in the Blogs section. I usually have one main design, but I only need TVs for certain sections (contexts arent quite here yet =). So this is my way to have one template with different sections of TVs (or my context hack if you will)
But it could very well work for adding TVs such as "Right Column, Left Column". Then in your only template you could say "if Left Column == 1, then show this part (via phx or chunk). is that what you meant?.
I need to get on the wiki and post some of my descriptions and how-tos. Most of them are for beginners (or at least i hope to think they can understand them).
Can we/I create a new wiki category called for beginners?
on a side note, can someone look at this hack-up job I did to show feeds? I want to be able to call it multiple times on a page and am stuck (d@mn nubies! =) I think it can be a great resource.