Rich-text Reply

Removed elements re-appearing in parent element when attempting to edit HTML

kmalone 12-20-18
Accepted Solution

Removed elements re-appearing in parent element when attempting to edit HTML

Hey all,

 

I'm encountering what I believe is a bug that is making it difficult for me to progress and add content to my pages main parent element. Essentially when I enter and select the selector for the container, in the "html" section I can see all the old code that I had removed and none of the code that I have added. So its impossible for me to edit my existing template without wiping out 100% of my changes. Cant seem to get around it.

 

Wondering if anyone has encountered this and knows a fix or a workaround?

 

Thanks!

Level 2

JasonDahlin 12-21-18
 

Re: Removed elements re-appearing in parent element when attempting to edit HTML

[ Edited ]

If I'm following your description correctly, this is intentional.
Your changes are a set of instructions which get applied to the page. When you look at the HTML in the WYSIWYG editor, you see the original page (that your changes will be applied to).

IMO, stop using the WYSIWYG editor and start using custom code to make your changes. You'll be able to do soooo much more that way (but does require a coding background). If the changes are simple, the code will be simple too. If the changes are complex, you probably don't want the WYSIWYG editor writing the code for you anyway.

--Jason Dahlin
Analytics and Testing Guru Smiley Happy


Experimentation Hero
kmalone 12-21-18
 

Re: Removed elements re-appearing in parent element when attempting to edit HTML

[ Edited ]

thanks for the response! Interesting, and good suggestion. Obviously I'm missing something important.

Do you know where I would look to insert custom HTML into the page? I assumed that was the only spot (clicking an element/using a selector to narrow in on it, and then in the HTML section on the left-hand sidebar to write markup in the HTML coding block). Seems to have worked to an extent. (though sometimes finding the parent elements "read-only" after editing a child in addition to my above issue).

In the code edit area I only see options to add Javascript/Jquery and CSS. Is there some method I'm missing? Possibly a specific area of the documentation that I can reference? The only other option I can think of is to use javascript/jquery to inject HTML into the view.

Sorry if my description is a bit confusing. Thanks again!

Optimizely_forum.png
Level 2
JasonDahlin 12-21-18
 

Re: Removed elements re-appearing in parent element when attempting to edit HTML

You found it!

The "Variation Code Editor" (top right TV looking thing) is where you enter custom code that makes the changes.

 

Looking through some of the experiments you are running, some simple jQuery could be used and would allow you the flexibility to easily create variations on the same text or otherwise modify the area with additional changes.

 

Most of your experiments look like text changes.

 

The jQuery for making these change would be like:

$('#cpy-hero .content p').html('All-in-one invoicing & payments... ');
$('h1').html('Get Started Free');
$('h1').html('The Better Way To Invoice');
$('.cta-subtext-assurance a.primary-cta').html('Get Started Free');

 

--Jason Dahlin
Analytics and Testing Guru Smiley Happy


Experimentation Hero
kmalone 12-21-18
 

Re: Removed elements re-appearing in parent element when attempting to edit HTML

Word 2 big bird. Thanks for the quick response. Happy holidays! =)
Level 2