- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Make Empty Paragraphs in DOM Editor output <p></p>
Does anyone know how to make empty paragraphs in the DOM editor output "<p></p>"?
I don't actually like the idea of doing this but we need a way of having the empty lines in the DOM be respected.
At the moment, our content entering people have to place lots of line breaks in the middle of content, it gets very confusing.
Alternatively, is there an actual WYSIWYG text editor for FirstSpirit? One that produces the same XML needed for the DOM object, but that displays the text more as it appears on the website.
- Labels:
-
Developers
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
no it is not identical. Yours is a little bit longer than the Mithras' one.
That is the Mithras-Code (FS5):
<p class="section">$--
--$$CMS_IF(#content.isEmpty)$$--
--$  ;$-- // <-- here the blank character between the "p" and the ";" has to be removed, when you copy the code
--$$CMS_ELSE$$--
--$$CMS_VALUE(#content)$</p>$--
--$$CMS_END_IF$$--
--$</p>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What does your template for "p" looks like? If you check the demo project "Mithras Energy" you'll see that it does just what you want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Our current "p" format template looks like this:
$CMS_SET(listLayer,0)$
$CMS_SET(startTag,"")$
")$
$CMS_SET(endTag,"
$CMS_SET(text,#content.toString.trim())$
$CMS_IF(text.length() > 6 && "
".equals(text.substring(0,6)))$
$CMS_SET(text,text.substring(6).trim())$
$CMS_END_IF$
$CMS_IF(text.length() > 6 && text.endsWith("
"))$
$CMS_SET(text,text.substring(0,text.length()-6).trim())$
$CMS_END_IF$
$CMS_IF(!text.isEmpty())$
$CMS_SET(output,startTag + text + endTag)$
$CMS_VALUE(output.replaceAll(startTag+endTag,""))$
$CMS_END_IF$
I don't have access to the "Mithras Energy" demo project, so can't compare it to the one in there. Is it identical?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
no it is not identical. Yours is a little bit longer than the Mithras' one.
That is the Mithras-Code (FS5):
<p class="section">$--
--$$CMS_IF(#content.isEmpty)$$--
--$  ;$-- // <-- here the blank character between the "p" and the ";" has to be removed, when you copy the code
--$$CMS_ELSE$$--
--$$CMS_VALUE(#content)$</p>$--
--$$CMS_END_IF$$--
--$</p>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Michaela, that pointed me in the right direction.
Regarding an alternative WYSIWYG text editor for FirstSpirit, do you know if that's a possibility, either in FS4 or 5?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
SimonB schrieb:
Regarding an alternative WYSIWYG text editor for FirstSpirit, do you know if that's a possibility, either in FS4 or 5?
The same question was asked here, i guess.
Jรถrg answered there, that it is possible to create an "individual" input element with the help of SwingGadgets. This "individual" input element could reference an editor, if the editor offers an interface.
(The manual for developers (components) might help, but it is just available in german.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Interesting, do you know of anyone who uses an external editor? Or of any such editors that offer an interface?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm sorry, but both questions i can just answer with "No"...
Maybe the author of the linked thread implemented such an input element with an external editor after Jรถrgs answer... ? But that is just a guess. I don't have futher information if Jรถrgs answer helped him or not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I changed Standard format template and has successfully removed <p></p> where ever empty content found.
$CMS_SET(text,#content.toString.trim())$
$CMS_IF(!text.isEmpty)$
$CMS_IF(text.startsWith("<ul>"))$
$CMS_VALUE(text)$
$CMS_ELSE$
<p>$CMS_VALUE(text)$</p>
$CMS_END_IF$
$CMS_END_IF$

