Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Indivirtual 5 posts 50 karma points
    Aug 18, 2014 @ 08:00
    Indivirtual
    0

    Umbraco 7 TinyMCE does not allow Google Rich Data Tagfing?

    Hello, 

    We are trying to use schema.org SEO rich data tags on our website. As an example we want to tag our office location in our contact us page: http://www.indivirtualdubai.com/contact 

    The office location is managed in a Rich Text Editor. When we copy the following marked-up HTML into the editor:

    <p itemscope itemtype="http://schema.org/LocalBusiness"> <span itemprop="name">Indivirtual LLC</span><br/> <span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"> <span itemprop="streetAddress">Office 107 <br/>The Elite Business Center <br/>Al Barsha 1</span>, <span itemprop="addressLocality">Dubai</span> </span><br/>T <span itemprop="telephone">+971 4 354 9388</span> <br/>F +971 4 354 9377</p>

    ... the editor automatically strips out all the rich markup tags. 

    How can we configure the Umbraco TinyMCE to allow all rich markup tags? I think that this is something that Umbraco should consider as default functionality as schema.org markup is really becoming more and more important. 

    Thanking you in advance 

    Adam @ Indivirtual Dubai

  • Adam Maidment 54 posts 163 karma points
    Oct 30, 2014 @ 11:29
    Adam Maidment
    0

    Hi,

    I can second this. I have set TinyMCE to allow all tags and set up the config files, touched the web.config file etc etc.

    This code:

    <div class="address" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
      <meta content="Head Office" itemprop="name" />
      <span itemprop="streetAddress">Address 1</span>
      <span itemprop="streetAddress">Address 2</span>
      <span itemprop="addressLocality">Town</span>
      <span itemprop="addressRegion">County</span>
      <span itemprop="postalCode">Postcode</span>
      <meta content="United Kingdom" itemprop="addressCountry" />
    </div>

    gets converted to:

    <div class="address">
    <span itemprop="streetAddress">Address 1</span>
    <span itemprop="streetAddress">Address 2</span>
    <span itemprop="addressLocality">Town</span>
    <span itemprop="addressRegion">County</span>
    <span itemprop="postalCode">Postcode</span>
    </div>

    I've used the same procedure in Umbraco 6 sites perfectly so there if definitely an issue with Umbraco 7.

    Does anyone have any ideas?

  • Danny Blatant 91 posts 358 karma points
    Oct 30, 2014 @ 15:36
    Danny Blatant
    0

    That's weird, especially as you say you've addressed the <validElements> node in config/TinyMceConfig.config...

    Can you post your <validElements> nodes?

    It looks like it accepts them on the span tags no problem, but it's stripping the meta tag completely and trimming attributes on the div, so I've had a crack at my own installation (U7.1.4), here's some excerpts from my validElements :

    -div[id|dir|class|align|style|itemprop|itemscope|itemtype] //extended with itemprop, etc
    
    -span[class|align|style|itemprop|itemscope|itemtype] //extended with itemprop, etc
    
    -meta[content|itemprop|itemscope|itemtype] //this one I added
    

    then deleted App_Data/umbraco.config, touched the web.config and rebuilt. I do however get the same error as you guys.

    I found this post which refers to the TidyEditorContent config value, but I tried this and am still getting things cleaned.

    I would add my vote confirming its Umbraco and not TinyMCE though. it seems to be outside the TinyMce handler thats cleaning it...

    Ammendum For s**t's and giggles, I scanned the ~/umbraco/TinyMce3/tinymcesrc.js file. This file defines the schema's the editor uses. I do note that there is mention of itemprop in the html5 schema list, but no itemscope or itemtype. This might be a clue, might not, but I thought I'd mention it...

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Oct 30, 2014 @ 16:47
    Jan Skovgaard
    0

    Hi Guys

    May I ask what the scenario for adding rich snippet data using the Rich text editor is? What type of content is it that you need to add rich snippets to? Could it be structured in another way so that it's not something that needs to be done in an RTE field? It seems very fragile imho. If it's products, movies, or some other content that can be categorized and structured then it does not sound like something that should be administered in a rich text editor.

    And since it's not something that should be an editor task either (once again imho) then I think you need to rethink how you build your sites instead. Stuff like this does not belong in a rich text editor. Then you're probably better of using the structured markup helper instead.

    I agree that rich snippets are important but I disagree that it's something that you should be allowed to edit and manage from a rich text editor field and the use of rich text editors fields are hopefully going to decrease in favor of other ways of handling page content and structuring of content like for Umbraco the upcoming grid property editor, Archetype or Sir Trevor.

    Looking forward to hearing from you guys - All I'm trying to say is that there may be a better way around it than managing it through the rich text editor :)

    /Jan

  • Adam Maidment 54 posts 163 karma points
    Oct 30, 2014 @ 16:53
    Adam Maidment
    0

    Hi Jan,

    In fact  I've gone and readjusted the code now so the editor is only used to insert;

    <spanitemprop="streetAddress">Address 1</span>
    <spanitemprop="streetAddress">Address 2</span>
    <spanitemprop="addressLocality">Town</span>
    <spanitemprop="addressRegion">County</span>
    <spanitemprop="postalCode">Postcode</span>

    which works fine for our solution. However, that aside, if we wish for the editor to accept any and all code, as developers we should be able to have control over this, so rethinking the solution is great, but the issue is still relevant.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Oct 30, 2014 @ 17:05
    Jan Skovgaard
    0

    Hi Adam

    Well, if editors are going to tell Google what parts of the content should be marked up with rich snippet I think they should be introduced to the Structured markup helper tool instead though.

    But I just don't feel that any editor should know how to add HTML to the content they write, to mark it up as rich snippets. But that does of course not remove the developer frustration of not being allowed to add it as a developer who knows what he is doing.

    An approach could be to introduce a simple mark-down like syntax and then parse the content using a regular expression, making sure that the snippets are added to the rendered HTML. A bit cumbersome though but it can be done and it's something that's probably easier to educate the content editors of doing I think.

    /Jan

  • Danny Blatant 91 posts 358 karma points
    Oct 30, 2014 @ 17:30
    Danny Blatant
    1

    Another approach that I've used for a contact form that features an address and phone number, but is used across the site (within rich text area's and out) is to use a Partial View Macro with Parameters.

    Now granted the parameters at the moment are fairly primative, but with a PVM you could add the relivent fields (i.e. Address 1, Address 2, PostCode and Phone). The editor would drop the PVM into the RTE and fill out the form, likewise you can re-use the PVM inside a normal template.

    The benifit here is that the PVM is rendered with its own Model and View, which is not constrained byt the RTE tidying, and the markup is not included in the RTE save data. In the view you can simply add your rich spans and div container, complete with html5 attributes, and insert the supplied values.

    Just another thought on how to achieve.

    Kind Regards,

    Danny "Blatant"

Please Sign in or register to post replies

Write your reply to:

Draft