Revolution 2.2.12 (but will update to the latest 2.2.13)
Hello,
This may be a simple question, but I can't find the answer...
Building a site that will have 3 columns of content on (almost) every page (a main, wide column in the middle, and 2 "sidebars", one left, one right. These are made from <DIV>s. I have no idea in advance what might be in the 3 columns.
Seems like I'd need [content1], [content2], and [content3] rather than just [content], but I know that's not how it works.
How is it done?
Thanks!
Dennis
This really depends on what will be the content of these columns.
If this are just three columns for free-text, then you can create two TVs, textarea or richtext for sidebar_right and sidebar_left in addition to the default content-field.
If this are different code-blocks and you want to add/remove multiple of them, you can create different chunks, have a checkbox-TV, where you can switch them on and off.
Or you could use Asides or a MIGX-TV to add as many code-blocks in any order.
-
☆ A M B ☆
- 3,141 Posts
I hope you'll forgive the shameless plug and the post on a month old thread, but
ContentBlocks is perfect for your use case. We're just working on the final bugs and features before public launch, but if you shoot me an email I'll gladly set you up with beta access.
As if you don't have enough options already, another option is to extend the modResource object to add your other two fields, which (another shameless plug) you can do fairly easily with ClassExtender:
http://bobsguides.com/classextender-class.html
These suggestions are not too late! I have the luxury of replacing a fully working website, so they are not dying for me to finish the new one (though I want it finished ASAP.)
Mark, ContentBlocks looks good. I actually wrote a small content management system from scratch a few years ago, and used the "template" feature of CKEditor to provide a similar functionality. Using CSS tables, I was able to define a visible (dotted line) structure for the website content creator that was actually a table with no borders. I did not see a way to do the same with DIVs in CKEditor, that would provide a visible framework in the editor, which would not render on the page. I am interested to try ContentBlocks, and willl shoot you an email.
Bob, first, I have to thank you for the time you've taken to write-out your guides. They are a big help.
On first blush, I did not see how ClassExtender would provide the functionality I'm looking for, but I'll study more carefully. Since I'm very new to MODX, I may need hand-holding to see this through your eyes.
Dennis
p.s. the big picture:
The grand idea is to get as close to WYSIWYG content entry as possible, and yet protect the content editor from messing with the underlying code. Using [[content]] and 2 TVs works to protect the underlying HTML (just the beginnings and endings of DIVs, with CSS classes, really) interspersed between content blocks. But, it doesn't even resemble WYSIWYG.
Part of the problem is that the CKEditor uses a single CSS file, universally across the entire MODX-based site, to render the WYSIWYG display (the same everywhere.) If the content blocks actually are supposed to use different CSS classes (a common situation on websites), there is no way to specify that per TV and per [[content]] areas.
On the other hand, the web developer can use a single CKEditor textarea to represent the entire page, all 3 columns, with columns WYSIWYG rendered correctly depending on their class, but then the HTML is exposed to the content editor, and the content editor could break the page.