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
09:00 - 17:00 Europe/London (BST)

Please create a new Ticket and we will get back to you as soon as we can.

#108771 automated inserts

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by rojteatern on Monday, 06 September 2021 15:05 BST

rojteatern
Hi,
Trying to edit some code but the editor reverts it.

Got the code:
<p>Du har bokat:<br />{TicketInfo}<br />Rabatt: {Discount}<br />Summa: {TicketsTotal}</p>

Get errors due to the {TicketsInfo} contains <p></p> so I get 2 starting <p> and 2 ending </p> witch screw things up.

Would like to change the code to:
<p>Du har bokat:</p>{TicketInfo}Rabatt: {Discount}<p>Summa: {TicketsTotal}</p>

But the editor puts a <p> before {TicketInfo} and </p> after {Discount}.

Had to disable the editor to be able to get what I want.

Ryan
When inserting the code, make sure each part is on a different line, eg:

<p>Du har bokat:</p>
{TicketInfo}Rabatt: {Discount}
<p>Summa: {TicketsTotal}</p>

Ryan Demmer

Lead Developer / CEO / CTO

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

rojteatern
Hi,
I've done that ...

I configure "code":
<p>Du har bokat:</p>
{TicketInfo}Rabatt: {Discount}
<p>Summa: {TicketsTotal}</p>

Saving and its the same in "code".
But then I switch between "Editor" and "code" or "Preview" and "code"and get this:
<p>Du har bokat:</p>
<p>{TicketInfo}Rabatt: {Discount}</p>
<p>Summa: {TicketsTotal}</p>

Maybe its a error in insertion just because I switch since if I don't save again - just "cancel" and open in "code" again - its still correct.

Its confusing because one wants to see the code-changes in editor or preview.

//Dennis

Ryan
As far as the editor is concerned, {TicketInfo}Rabatt: {Discount} is just text (which it is), which is why it is wrapped in a paragraph.

To prevent this, set Protect Shortcode to Yes in Editor Profiles -> Editor Parameters -> Advanced.

Ryan Demmer

Lead Developer / CEO / CTO

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

rojteatern
Hi,
That seems to work!

Thanks!
Dennis