Copied to clipboard

Flag this post as spam?

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


  • Jarrod Vanstan 4 posts 74 karma points
    Jul 05, 2016 @ 04:35
    Jarrod Vanstan
    0

    XSLT macro is hidden in RTE when permissions are applied

    I would like my macro to render in the RTE, but when I wrap my XSLT macro with the following permissions, the macro doesn't display.

    I only see the dotted orange border of the .umbMacroHolder:

    <xsl:if test="count($currentPage/child::*[@isDoc and string(umbracoNaviHide) != '1' and (umbraco.library:IsProtected(@id, @path) = false() or umbraco.library:HasAccess(@id, @path) = true()) and string(hideFromTopNavigation) != '1' and string(@template) != '0']) &gt; 0">
    </xsl:if>
    

    What can I do to get the macro to display?

    I have checked the Render content in editor checkbox.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 05, 2016 @ 06:06
    Jan Skovgaard
    0

    Hi Jarrod

    What is the macro supposed to do? And does the content show if you uncomment the if sentence around it?

    It might be a bug in the particular version of Umbraco 4 that you're using - What is the exact version you're using?

    /Jan

  • Jarrod Vanstan 4 posts 74 karma points
    Jul 05, 2016 @ 06:14
    Jarrod Vanstan
    0

    Hi Jan,

    The macro lists sub pages.

        <xsl:variable name="mod" select="number(2)"></xsl:variable>
    <xsl:if test="count($currentPage/child::*[@isDoc and string(umbracoNaviHide) != '1' and (umbraco.library:IsProtected(@id, @path) = false() or umbraco.library:HasAccess(@id, @path) = true()) and string(hideFromTopNavigation) != '1' and string(@template) != '0']) &gt; 0">
        <table width="630" border="0" cellspacing="0" cellpadding="0" class="contentsPageSubList">
            <tr>
                <td class="leftCol"><p class="feature">Contents:</p></td>
                <td class="rightCol">&nbsp;</td>
            </tr>
            <xsl:for-each select="$currentPage/*[@isDoc and string(umbracoNaviHide) != '1' and (umbraco.library:IsProtected(@id, @path) = false() or umbraco.library:HasAccess(@id, @path) = true()) and string(hideFromTopNavigation) != '1' and string(@template) != '0']">
                <xsl:if test="position() mod $mod = '1'">
                    <xsl:text disable-output-escaping="yes"><![CDATA[<tr>]]></xsl:text>
                </xsl:if>
                <td>
                    <xsl:if test="position() mod 1 = 0">
                        <xsl:attribute name="class">leftCol</xsl:attribute>
                    </xsl:if>
                    <xsl:if test="position() mod 2 = 0">
                        <xsl:attribute name="class">rightCol</xsl:attribute>
                    </xsl:if>
                    <h2><a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName"/></a></h2>
                </td>
                <xsl:if test="position() mod $mod = '0' or position()=last()">
                    <xsl:text disable-output-escaping="yes"><![CDATA[</tr>]]></xsl:text>
                </xsl:if>
            </xsl:for-each>
        </table>
    </xsl:if>
    

    If I remove the following from the above code the macro will display:

    (umbraco.library:IsProtected(@id, @path) = false() or umbraco.library:HasAccess(@id, @path) = true())
    

    I'm using Umbraco 4.11.10

    Cheers, Jarrod

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 06, 2016 @ 07:20
    Jan Skovgaard
    0

    Hi Jarrod

    Hmm, I tried checking the issue tracker to see if this was reported as a known bug - But skimming this list http://issues.umbraco.org/issues/U4?q=%234.11.10 it does not seem like it.

    Even though it's frustrating that the content does not render I suppose it works as it should when loading the website? I guess that when the macro is called from within the RTE field the test is false and then content of the macro does not show, which makes sense. But I get that it might be a bit confusing for the editor that nothing is shown but I doubt that there is much to do about it - It's not something that is going to be fixed for this version of Umbraco since development of the v4 branch is discontinued. Only security issues will be fixed.

    Probably not the answer you were hoping for but unless you're able to make a fix/workaround for it yourself then there is not much to do about it.

    Cheers, Jan

Please Sign in or register to post replies

Write your reply to:

Draft