We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17548
    • 74 Posts
    I don’t really know how to word this, so bear with me (brevity is not one of my strong suits):

    The beauty of Modx is the flexibility with which I can break apart content areas of a page for my non-html savvy editors.

    However, I can’t figure out how to give them the WYSIWYG benefit of TinyMCE when editing discrete content out of context.

    For example, if a user is editing a TV in WYSIWYG, I want the content to look as closely to the way it looks on the published page. But because it may represent only a fragment of the overall html, the cascade of selectors doesn’t get inherited and my content, while nicer to edit, still doesn’t look like the final site.

    Ideally, I want the context of the WYSIWYG editor to inherit the context of the template used by the page, or if it’s a TV, I want to provide an HTML context for the editable content. For example, I have a TV that is basically structured:

    <ul>
    <li><a><img/></a></li>
    </ul>

    In WYSIWYG mode, this displays as a bulleted list with my image and url.

    What I want, is to provide a wrapper context, so that the WYSIWYG view assumes:

    <div id="sidebar">
    <ul>
    <li><a><img/></a></li>
    </ul>
    </div>

    I can then create a custom css that, for the purposes of editing, provides a #sidebar context for the .mceContentBody class to display the <ul> markup with appropriate styles.

    Thanks for your patience.
      • 3440
      • 17 Posts
      I would also greatly appreciate such a possibility. Can’t figure out how to achieve this though.

      As a starting point I’m already trying to achieve something seemingly easier: having different css files loading for different templates.
      I assumed that using a custom "Properties set" for a specific template, setting the "editor_css_path" would allow for the tinyMCE iframe to load the specified css file. But this does not work :-(

      Could any skilled MODx developer consider this question and tell us if anything is possible in that matter ? I’m definitely convinced that this is a recurrent problem for many of the MODx users. MODx is so incredibly powerful in all kinds of possibilities it offers, but the RTE is still a weak point. TinyMCE’s tendency to "rewrite" and modify the inputted HTML is a real pain most of the time and I often find my end users complaining that, in the end, their content modifications cannot be achieved using the WYSIWYG interface, sending them back to raw HTML editing which is, IMHO, not acceptable when building a professional CMS.

      Until the day comes that a structured, viable solution is available, I’ll continue to go my DIY way. Building front-end templates containing unnecessary markup tags, and sometimes even oddly structured sections, then building a cumbersome "editor.css" file, simply to allow for the RTE to render it’s content as close as possible to the final output.

      Thanks for paying attention to this remark as, once again, I really think that this point is a bit neglected by the MODx team at the time being. I know that it is not part of the MODx core, it has to be an add-on business but, please, consider that the end users are faced daily with the RTE and, often, they find themselves disapointed in the end, not being able to achieve their goal unless extensively trained...

      Regards.