Jump to content

How to bypass cms htmp parser


Recommended Posts

I added divs with microdata to a cms page but the parser deleted them when cleaning up the code. 

 

How can I bypass the parser so that I can add my company name, adress and phone in schema.to my "contact us" page so that google can get local info about my business?

 

This:

<div itemscope itemtype="http://schema.org/Organization"> 
   <span itemprop="name">biz name.</span> 
   Address
      <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
      <span itemprop="streetAddress">Street 9</span>,
      <span itemprop="addressLocality">City</span>,
      <span itemprop="addressRegion">Region/span>.
      <span itemprop="postalCode">12345</span>,
      <span itemprop="addressCountry">Country</span>,
   </div>
  <img itemprop="logo" src="http://www.domain.com/img/logo.png" />
   Phone: <span itemprop="telephone">123456789</span>
   <a href="http://www.domain.comk/" itemprop="url">http://www.domain.com</a>
</div>	

gets automatically changed to this:

<div><span>biz name</span>Address
<div><span>Street 9</span>, <span>City</span>, <span>Region</span>. <span>12345</span>, <span>Country</span>,</div>
<img src="http://www.domain.comk/img/logo.png" alt="" /> Phone: <span>123456789</span> <a href="http://www.domain.comk/">http://www.domain.com</a></div>

:(

Edited by SkyHiRider (see edit history)
Link to comment
Share on other sites

  • 4 months later...
This doesnt work!
 
Code must be purified somewhere else too!!
 
Even when a change the function purifyHTML in /classes/Tools.php to:
 
public static function purifyHTML($html, $uri_unescape = null)
{
    return $html;
}

It doesnt work!

Edited by heyho (see edit history)
Link to comment
Share on other sites

Here is my solution:

 

1) Deactivate purifyHTML in preferences > general

2) Modify the TinyMCE Configuration File (/js/tinymce.inc.js):

//extended_valid_elements : "em[class|name|id]",
extended_valid_elements : "div[*],span[*],ul[*],li[*]",
valid_children: "+body[style|script],pre[script|div|p|br|span|img|style|h1|h2|h3|h4|h5],*[*]",
valid_elements : '*[*]',
cleanup: false,

Edit: ...doesnt work with meta - tags inside the body - tag (openingHours)...

Edited by heyho (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...