We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 727
    • 502 Posts
    I want to make it easy for non-technical editors to create something like:

    <div class="box">
      <div class="wrapper">
        <p>Something</p>
      </div>
    </div>


    I created two chunks called "box-header" and "box-footer" so it becomes:

    {{box-header}}
    <p>Something</p>
    {{box-footer}}


    The problem is that TinyMCE adds paragraph tags around the chunks when they are added. Although this appears to display OK, I don’t like it.

    Sure, I can tell users to set the format field to "format" when the chunks are added, but later editing may cause TinyMCE to add the paragraph tags back in again.

    Are there any better solutions or ideas for doing something like this?

    thanks, Andy
      • 727
      • 502 Posts
      Well... I decided to use TinyMCE templates to insert the boxes. If there are any better ideas please post.

      Andy
        • 3749
        • 24,544 Posts
        You don’t give the details of the situation, but usually you can put those formatting divs in your template and just have the user enter the content.
          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
          • 727
          • 502 Posts
          These are for blocks that the user can insert into a page, for example to highlight something. Their usage depends on the page content.

          Andy
            • 25663 MODX Staff
            • 12,272 Posts
            It’d be great to share how you did that with Tiny Templates. Those are honestly the right solution I think.
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 26931
              • 2,314 Posts
              anonymized-26931 Reply #6, 17 years ago
              It’d be great to share how you did that with Tiny Templates. Those are honestly the right solution I think.
              hey Ryan, see here:
              http://modxcms.com/forums/index.php/topic,41005.msg247078.html#msg247078
                • 26931
                • 2,314 Posts
                anonymized-26931 Reply #7, 17 years ago
                The problem is that TinyMCE adds paragraph tags around the chunks when they are added. Although this appears to display OK, I don’t like it.

                have a look at this thread -> http://modxcms.com/forums/index.php/topic,28908.0.html
                  • 727
                  • 502 Posts
                  Thanks. I wonder if that option can be added to the plugin configuration, rather than editing source code? Have to give it a try. In general adding paragraph tags around everything is quite annoying.

                  Andy