You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Offline

Official support hours:
Monday To Friday
From 09:00 To 17:00 Europe/London (BST)

Please post your question in the Forum and we will get back to you as soon as we can.

  Saturday, 24 July 2021
  12 Replies
  1K Visits
I use Articles Anywhere from Reular Labs which is a great extension.
To use it, one must put code in articles or modules like:

{articles catid="27" ordering="created ASC" limit="13"}
<div class="article-tile"
{if tags=ritten} style="background-color: #ffedc6;"
{elseif tags=reizen} style="background-color: #e3ffdf;"
{else} style="background-color: #e2dede;"{/if}">
<h4>[link][title][/link]</h4>
[image-intro][introtext]
<div class="tags">[tags]</div>
</div>
{/articles}

What that code does is: show as tiles (the css is in the template) the title as H4 link, intro-image and intro-text from max 13 articles having category 27, and colour them by tag.

Now what JCE does (in editor on mode) is stripping out most of the code, despite all settings like no html validation, etc.
The only thing which more or less works is: Profiles / Editor parameters / Advanced > Protect Shortcode = Yes.
Then most of it remains intact when a user (accidentially) opens and saves the module in editor mode.

Could we have a mode please that does not try to correct the content at all?

Best,
Eric
more than a month ago
·
#108384
Excellent! :D

Just because you're not paranoid doesn't mean everybody isn't out to get you.

more than a month ago
·
#108383
Yes!
For me it works too, another step forwards
more than a month ago
·
#108381
I"m not seeing any change to the code in my tests using your example in Beta 6 - https://www.joomlacontenteditor.net/downloads/editor/pro/development

Just because you're not paranoid doesn't mean everybody isn't out to get you.

more than a month ago
·
#108377
The complete code is:

<div class="blokkenrij" style="clear: both;">

{articles catid="36" ordering="created ASC" limit="10"}
<div class="art-tegel" style="background-color: #e8f6fd;">
<h4>[link][title][/link]</h4>
[image-intro][introtext]
</div>
{/articles}

{articles catid="27" ordering="created ASC" limit="13"}
<div class="art-tegel"
{if tags=ritten} style="background-color: #ffedc6;"
{elseif tags=reizen} style="background-color: #e3ffdf;"
{else} style="background-color: #e2dede;" {/if} >
<h4>[link][title][/link]</h4>
[image-intro][introtext]
<div class="tags">[tags]</div>
</div>
{/articles}

</div>

So there are 2 series of article intro tiles in a div that has next css:

display: flex;
flex-direction: row;
flex-wrap: wrap;

and the tiles themselves have the following css:

display: flex;
flex-direction: column;
padding: 10px;
margin: 5px;
float: left;
more than a month ago
·
#108375
Although it stripped out my encapsulating div (not shown in the code snippet at the top).
I would prefer to keep that div as it is a flex container for the tile elements. Is it possible?


Please post an example of the code I can test with.

Just because you're not paranoid doesn't mean everybody isn't out to get you.

more than a month ago
·
#108374
JCE Pro 2.9.11 Beta 5 works a lot better, thanks! It did not insert a data-mce-code="shortcode but seems to recognise the code anyway.

Although it stripped out my encapsulating div (not shown in the code snippet at the top).
I would prefer to keep that div as it is a flex container for the tile elements. Is it possible?
more than a month ago
·
#108373

Just because you're not paranoid doesn't mean everybody isn't out to get you.

more than a month ago
·
#108372
Sometimes it seems to work and the editor inserts a data-mce-code="shortcode" in my first div.


The code cannot be inside another tag, like a div. This is not currently supported.

Just because you're not paranoid doesn't mean everybody isn't out to get you.

more than a month ago
·
#108371
And sometimes the editor shows a more or less unformatted mode of the text with "shortcode" menioned (see scereenshot).


The code will not show as HTML, because it is not valid HTML, and in order to protect it, it must be displayed as plain text.

But always after saving that is gone.
And often by switching the editor mode the code is messed up.


This is working in my tests with the code example you posted above. Please make sure that the Validate HTML option is set to Yes in the Editor Global Configuration.

Just because you're not paranoid doesn't mean everybody isn't out to get you.

more than a month ago
·
#108370
Sometimes it seems to work and the editor inserts a data-mce-code="shortcode" in my first div.
And sometimes the editor shows a more or less unformatted mode of the text with "shortcode" menioned (see scereenshot).
But always after saving that is gone.
And often by switching the editor mode the code is messed up.
more than a month ago
·
#108369
I may have been able to fix this, at least for distinct shortcode blocks as in your example above.

Please try JCE Pro 2.9.11 Beta 4 - https://www.joomlacontenteditor.net/downloads/editor/pro/development

You will need to enable the Protect Shortcode option.

Just because you're not paranoid doesn't mean everybody isn't out to get you.

more than a month ago
·
#108367
Now what JCE does (in editor on mode) is stripping out most of the code, despite all settings like no html validation, etc.
The only thing which more or less works is: Profiles / Editor parameters / Advanced > Protect Shortcode = Yes.
Then most of it remains intact when a user (accidentially) opens and saves the module in editor mode.

Could we have a mode please that does not try to correct the content at all?


JCE is primarily an HTML editor, and in order to operate as an HTML editor, it has to stick to certain HTML rules, and process code entered into it to allow the content to be editable in a WYSIWYG way.

Shortcode, eg: {article} is not HTML code, and in the context of an HTML editor like JCE, is actually just text, and is treated accordingly.

I have tried to the best of my ability to attempt to provide a way to preserve some shortcode within HTML - via the Protect Shortcode option - but when the shortcode is mixed with HTML - especially in complex ways that you are using it - this become almost impossible. This process is ongoing, and I might have a breakthrough one day where I figure out how to do it successfully, but at this stage it is not a priority.

Just because you're not paranoid doesn't mean everybody isn't out to get you.

  • Page :
  • 1
There are no replies made for this post yet.
Be one of the first to reply to this post!