[I’m running Revolution beta 5]
Hi, I’m having trouble working out how to create multiple content areas automatically.
This is my ideal layout:
I want the maintainer to be able to add as many blocks of content (an h2 plus a .box div), with custom headings and content, as they wish but without having to add in the <div class="box"> and </div> tags themselves.
This is my current method. For every single block apart from the first I use checkbox TVs to choose whether an h2+.box should be displayed, then two more textarea TVs for the h2 and content of that block (each through an individual chunk). My template thus contains something like this:
<div class="leftcol">
[[*left_column_title]]
<div class="box">
[[*content]]
</div>
[[*Showleftblock]] // this is a checkbox which returns a chunk containing h2+.box
</div>
<div class="rightcol">
[[*right_column_title]]
<div class="box">
[[*right_column_content]]
</div>
[[*Showrightblock]]
</div>
[[*Showbottomblock]]
This is approximately what it looks like:
The main and biggest problem with this arrangement is that it means a custom set of TVs and chunk has to be set up for as many blocks as someone might want to add (that would mean 9 TVs and 3 chunks for just 3 extra blocks of content). Other problems include that it is rather confusing for someone not technically inclined to work out what all the TVs do and that it’s hard to organise them. An ideal solution would have some kind of way of automatically outputting as many blocks as the person chooses on-the-fly, but I can’t see how this could be done. I’m sure it’s possible though, I’ve been very impressed with modx so far.
Thanks,
Ross
ps Please ask for clarification if you want it; I imagine this post is as clear as mud. Hopefully if I manage to work out a way of doing this it will serve as a good reference for others like me in the future.