Copied to clipboard

Flag this post as spam?

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


  • Matt Kemp 2 posts 72 karma points
    Dec 16, 2015 @ 04:21
    Matt Kemp
    0

    Partial View Macro - disallowed tags

    I've created a Partial View Macro - it's pretty basic - it just creates a special link - or it would do if it worked.

    My file is in Views/MacroPartials/BlackButton.cshtml and the contents are below:

    @inherits Umbraco.Web.Macros.PartialViewMacroPage
    <a href="#" role="button" class="leftbutton">Black button</a>
    

    However this renders out on the page like this:

    Macro alias: BlackButton

    I've experimented with different content in the BlackButton.cshtml file and if I change the HTML to just be:

    <div>some text</div>
    

    then it works.

    So there seems to be a problem with certain tags (it doesn't like anchors or the old b tag) or certain attributes (data-*, in this case that "role" one).

    Does anyone know why this is happening? Is there a list somewhere of allowed tags and attributes? Is there a way of disabling this?

    I'm also open to suggestions if there is a better way of inserting HTML snippets like this.

    Thanks in advance for any help.

Please Sign in or register to post replies

Write your reply to:

Draft