Copied to clipboard

Flag this post as spam?

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


  • Eric Herlitz 97 posts 129 karma points
    Mar 18, 2011 @ 17:01
    Eric Herlitz
    0

    Problems with migrating XSLT to new Schema

    I got this macro who's collecting articles (nodes) a hidden part of the site called "Article_archives". The articles are tagged with one or more categories (i.e 'baking, 'exercise', etc).

    To get the articles I used to use the code below, and I cant figure out how to upgrade it to the new schema :(

    <xsl:template match="/">
    
        <xsl:variable name="listcategory" select="umbraco.library:Split($currentPage/data[@alias='listcategory'],',')"/>
        <xsl:variable name="listname" select="@nodeName"/>
    
        <xsl:if test="$listcategory/value !=''">
    
        <xsl:for-each select="$currentPage/ancestor-or-self::node 
            [@level = 1]//node
            [umbraco.library:HasAccess(@id, @path) = true()]
            [umbraco.library:Split(data[@alias='Category'],',')/value = $listcategory/value]">
    
    

     

    Any help is highly appreciated!

    Cheers

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Mar 18, 2011 @ 17:08
  • Tom Fulton 2030 posts 4998 karma points c-trib
    Mar 18, 2011 @ 17:08
    Tom Fulton
    0

    Not tested, but try this: (just replaced /data [@alias='xx'] with /xx and /node with /* [@isDoc]

    <xsl:template match="/">
           
            <xsl:variable name="listcategory" select="umbraco.library:Split($currentPage/listcategory,',')"/>
            <xsl:variable name="listname" select="@nodeName"/>
           
            <xsl:if test="$listcategory/value !=''">
           
            <xsl:for-each select="$currentPage/ancestor-or-self::*
                    [@isDoc][@level = 1]//*
        [@isDoc]
            [umbraco.library:HasAccess(@id, @path) = true()]
                    [umbraco.library:Split(Category,',')/value = $listcategory/value]">
  • Petr Snobelt 923 posts 1535 karma points
    Mar 18, 2011 @ 17:10
    Petr Snobelt
    0
    <xsl:template match="/">

    <xsl:variable name="listcategory" select="umbraco.library:Split($currentPage/listcategory,',')"/>
    <xsl:variable name="listname" select="@nodeName"/>

    <xsl:if test="$listcategory/value !=''">

    <xsl:for-each select="$currentPage/ancestor-or-self::* [@isDoc][@level = 1]//* [@isDoc][umbraco.library:HasAccess(@id, @path) = true()]
    [umbraco.library:Split(Category,',')/value = $listcategory/value]">

    converted by http://blackpoint.dk/umbraco-workbench/tools/convert-xml-schema-to-45-.aspx

    Petr

Please Sign in or register to post replies

Write your reply to:

Draft