I just started using MODX so this may be obvious. I installed TinyMCE and I've noticed (when viewing the browser source code) that my nicely formatted code only lasts until I make an edit after which it gets aligned left with no indenting. Granted this isn't the worst thing but is there no way to ensure the formatting isn't lost with a RTE?
Thanks
Todd
Hi,
You shouldn't place your code directly in the main content area unless you really need to. AFAIK, TinyMCE will mess up the code regardless the CMS you use, as it's an external app intended to be used by end users with little HTML knowledge.
I don't know exactly what you're trying to accomplish, but probably there's a better place where you can place your code.
Hi,
Putting the code in the main content area (via TinyMCE) seemed logical since it is ... the main content of the page, and I didn't see any point in breaking it up into pieces, like TVs, for example. Though maybe that's what I need to do. But mostly the reason I did it this way is because the client needs a WYSIWYG editor. I'm surprised at how crappy most of these RTEs are, at least the ones that can be installed in MODX. I wish there were more MODX/RTE options available.
In any case I'm still trying to find my MODX workflow and while it would be nice (though not essential) to maintain the formatting if possible I would also be interested in hearing how others approach this.
Todd
Rule 1:
If you want your html-code to be as untouched as possible, don't use any RTE.
But mostly the reason I did it this way is because the client needs a WYSIWYG editor.
what exactly is the reason your client needs an RTE ?
There are many ways arround using them. But it depends on which kind of content he wants to add. So let us know more about the scenario.
If there is really no way arround it, in your clients case, there are still lots of configuration-options for tinyMCE.
You are right, RTEs very often behave badly, but there is not much alternative at the moment.
Can you please provide an example of the code you're placing on TinyMCE, so that we can understand if you're using MODX in the right way?
ok, I see. The modx-way would be to create a template with something like that:
[[$yourhead]]
<div id="content">
<div id="trans">
<div id="frame">
<p id="slider">[[snippetToCreateSlides]]</p>
</div>
<h1>[[*pagetitle]]</h1>
<div id="quote">
<h2><a href="???"></a>???</h2>
<p>[[*content]]</p>
<blockquote>????</blockquote>
</div>
</div>
<div id="new">
[[snippetWhichListsItems]]
</div>
</div>
[[$yourfooter]]
slides can be filled for example with something like MIGX
the 'new' - box can be filled for example with contents of subresources by getResources or also .... with MIGX, depending on what kind of content comes into that box.
So your client needs just to add real content and has nothing todo with the html-structure.
[ed. note: Bruno17 last edited this post 14 years, 3 months ago.]