We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36926
    • 701 Posts
    Hi,

    I currently have content pages that can have call out boxes within the main body of the page. So i need wrap parts of the content within a div to allow for the call outs to float nicely next to the relevant paragraphs. Below is an example, see the callOut and halfColumn divs, these always appear together but could appear anywhere in the content. So could be first, last or somewhere in between.

    <h2>sub header</h2>
    <p>some content</p>
    
    <h2>sub header</h2>
    <p>some content</p>
    <div class="halfColumn">
    <h2>sub header</h2>
    <p>some content</p>
    </div>
    <div class="callOut">
    Call out content
    </div>
    <h2>sub header</h2>
    <p>some content</p>
    


    So what i've actually done is set up MIGX with varying templates, if you have a callout you select the callout template and so on.

    This works fine but is it the right way to go, is there a better option, is there anything wrong with using MIGX for the whole of the content on a page?

    I'd thought about just having the call outs box in a MIGX list and then within the content you specify specific MIGX tag
     [[+idx]]
    I think this could potentially be a cleaner way of doing it but TINYMCE has that lovely habit of wrapping everything in a <p> tag, I know you can turn that off but then it doesn't wrap anything which is probablly more annoying.

    Would you approach this differently, i'm interested to know if so and how as been thinking for a while the best way to do this.
    • It's not at all unusual to completely replace the main content with TVs.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 36926
        • 701 Posts
        Yea i've done it before when i've had say a right and left column. But for some reason it doesn't quite seem right to use MIGX for the whole content. Maybe it's because the TV value isn't pure content and it's as JSON.

        Interested to know how others would of approached this.
          • 4172
          • 5,888 Posts
          One disadvantage of storing content in a JSON string is, it is not realy searchable.
          If you like to have searchable Content, you could create a custom-table and try todo the same with MIGXdb (new version is coming soon). Its also possible to store the items in both at the same time.

          It should also be possible to store the parsed result into the content-field or another TV or a custom table per plugin onDocFormSave.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 36926
            • 701 Posts
            I had looked into the MIGXdb but was waiting for it to come out of beta before I delved in any further.

            The idea of storing parsed results into content/TV via a plug in is a good idea.