We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46448
    • 98 Posts
    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
      • 4172
      • 5,888 Posts
      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.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 46448
        • 98 Posts
        Thanks for the quick reply, Bruno17.

        The sidebars will have content in them: headers, (well, probably <h2> headers), text, unordered lists, images... The website owner wants full freedom to put whatever they want in there. It won't be programmatic (like an RSS feed, or something like a list of latest blog entries.) They won't be code blocks.

        I'll explore the creation of 2 TVs, using richtext (hope I can use CKEditor, rather than TinyMCE - simply because I already know CKEditor.)

        Thanks again for your quick response!

        Dennis

        Quote from: Bruno17 at Mar 24, 2014, 11:00 AM
        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.
          • 18373 ☆ 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.
            Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

            Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
            • 3749
            • 24,544 Posts
            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
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 46448
              • 98 Posts
              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.