8

I am trying to put some html in my home page but whenever I save the page the tags are gone, it doesn't save.

Here is the html which I am trying to save in the page ie.

<section class="bottom_sec">
<div class="shop_bottom">
</div>
</section>
<section class="footer-container">
<figure class="footer-logo"><a href="#"><img src="{{skin url}}images/footer_logo.png" alt="footer_logo" /></a></figure>
</section>
</section>

Now when I click on the save button the <section> and <figure> tags are disappeared and my html looks like this

<div class="shop_bottom">
</div>
<p><a href="#"><img src="{{skin url}}images/footer_logo.png" alt="footer_logo" /></a></p>

How can I save these tags in the cms page. Does magento can save these tags or not. Thanks...

8

Interestingly enough the save is not the problem. If you copy your html into the cms page and then hit save you will see in the table cms_page that you have your full html in the database.

The problem is that tinymce strips out tags that are not allowed so that the next time you save the page the tags will be gone.

You need to extend the extended_valid_elements to include your desired elements.

Alan Storm has a complete explanation on his website

  • Well thanks it did work. Now I can easily modified my template page. Thanks again. – Waseem May 19 '14 at 7:48
1

The problem is with the WYSIWYG renderer as mentioned. The out of the box config for magento is set when saving, to reset the page view back to the WYSIWYG view and that's when your code gets rewritten.

A real nasty hack is to disable the render or set it to default to html in the config menu.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.