Copied to clipboard

Flag this post as spam?

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


  • Jose Blanco 12 posts 32 karma points
    Jun 23, 2012 @ 00:35
    Jose Blanco
    0

    How to review for internal and protected links

    Hello, 

    Is there a way to review for the urls before rendering in umbraco?, and If the urls are internal and protected how can I add a class ?

    I am using the richtext editor and I want to add a class = "pop" or something similar to all the urls that are portected for a determinate member, in the rendered page.

    I am using umbraco 4.5.2. 

    I am grateful for any suggestions. 

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jun 24, 2012 @ 05:15
    Tom Fulton
    0

    Hi Jose,

    If you were looping through the pages via an XSLT macro, such as for navigation, this would be easy to achieve by using the XSLT Helper method umbraco.library:IsProtected and/or umbraco.library:HasAccess, but it seems like you're wanting to do this for links that might be inserted in a Richtext editor, correct?

    In that case I think you're going to need to do some parsing of the RTE content before you render it -- parse all the links ({localLink:nodeId), run them through the helper method, and add the class if it returns true.  Depending on if you're using XSLT or Razor one of these blogs might give you an idea of how to do that.

    Transforming WYSIWYG output with XSLT [blog]

    - Use the HtmlAgilityPack - example:  Wrapping Images using the Html Agility Pack, TinyMce, Umbraco [blog]

    Not the cleanest solution, I know, but should work - let us know if you have questions...

    -Tom

  • Jose Blanco 12 posts 32 karma points
    Jun 25, 2012 @ 17:08
    Jose Blanco
    0

    Thanks Tom.

    I appreciate your comment.

Please Sign in or register to post replies

Write your reply to:

Draft