Copied to clipboard

Flag this post as spam?

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


  • Michael Jensen 35 posts 85 karma points
    Apr 16, 2013 @ 09:07
    Michael Jensen
    0

    Listing items i macro by tru/false

    Hey

    Iam tryning to make a macro that only list items that has True value in a check boks.

    the Alias of the True/fals is " delAfHovedForlb "

    iam not the best til XSLT programing so i hope som can help me. the Master macro i lige to use is the standart list sub by levl

     

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet 
    version="1.0" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:msxml="urn:schemas-microsoft-com:xslt" 
    xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:PS.XSLTsearch="urn:PS.XSLTsearch" 
    exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets PS.XSLTsearch ">
    <xsl:output method="xml" omit-xml-declaration="yes" />
    <xsl:param name="currentPage"/>
    <!-- Input the documenttype you want here -->
    <xsl:variable name="level" select="2"/>
    <xsl:template match="/">
    <!-- The fun starts here -->
    <ul>
    <xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
    <li>
    <a href="{umbraco.library:NiceUrl(@id)}">
    <xsl:value-of select="@nodeName"/>
    </a>
    </li>
    </xsl:for-each>
    </ul>
    </xsl:template>
    </xsl:stylesheet>

     

    Best regards 

    Michael

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Apr 16, 2013 @ 09:46
    Dennis Aaen
    0

    Hi Michael,

    From the top of my mind, I think you could do something like this:

    <xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
            <xsl:if test"./delAfHovedForlb = 1">
            <li>
                        <a href="{umbraco.library:NiceUrl(@id)}">
                                <xsl:value-of select="@nodeName"/>
                        </a>
                </li>
        </xsl:if>
    </xsl:for-each>   

     

    The link and the nodename will only be print if the delAfHovedForlb is set to true.

    I hope this can help you.

    /Dennis

  • Michael Jensen 35 posts 85 karma points
    Apr 16, 2013 @ 10:07
    Michael Jensen
    0

    Hey Dennis.

    Sorry to sat that dosent work. but thanks for you input.

     

    /Michael

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Apr 16, 2013 @ 10:39
    Dennis Aaen
    100

    Hi Michael,

    I just make a small test.

    With this code snippet I list all subpages (children) from the CurrentPage. And I only got the link and the nodename printet out for these pages where I checked the delAfHoverForlb property.

    All my pages in the test got the delAfHoverForlb property, but only one page have it checked, and I only get this one printet.

    <ul>
    <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
        <xsl:if test="./delAfHovedForlb = 1">

        <li>
            <a href="{umbraco.library:NiceUrl(@id)}">
                <xsl:value-of select="@nodeName"/>
            </a>
        </li>
        </xsl:if>
    </xsl:for-each>
    </ul>

    Hope it will help you in the right direction.

    /Dennis

  • Michael Jensen 35 posts 85 karma points
    Apr 16, 2013 @ 13:09
    Michael Jensen
    0

    Hey Dennis.

     

    that dit the trick.

     

    /michael

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Apr 16, 2013 @ 13:17
    Dennis Aaen
    0

    Hi Michael,

    I´am glad to here that. And just keep asking in this forum if you have any problems with Umbraco. I am sure that there is lots of people who will love to help you out.

    And just i case, remember to mark the right solution, in your questions, so others, there having the same or similar problem can see what worked for you.

    If don´t know how to mark a question as solved, feel free to ask, and then I will guide you.

    But good you got it working :-).

    Happy Umbraco coding

    /Dennis

  • Michael Jensen 35 posts 85 karma points
    Apr 16, 2013 @ 13:21
    Michael Jensen
    0

    hey Dennis,

    forgodt to set do to a phone call. and i will keep asking for help when i need but i do yse the serch first. to se if can fid the solutions.

    /Michael

     

     

Please Sign in or register to post replies

Write your reply to:

Draft