Copied to clipboard

Flag this post as spam?

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


  • Andy Peiris 5 posts 55 karma points
    Jul 25, 2013 @ 17:49
    Andy Peiris
    0

    XSLT for multi-url-picker

    Hi,

    I am a bit out of practice and got stuck with querying the multi-url-picker object. And there is no documentation about the usuage of the multi-url-picker with xslt.
    I have a Document Type called Vacancy with a Generic Type of Additional Documents, which is of Type multi-url-picker.

    This is what I have tried to do (and it doesn't do a thing ^^):

    <xsl:for-each select="$currentPage/* [name() = 'additionalDocuments' and not(@isDoc)]/multi-url-picker/url-picker">
            <li><img width="16" alt="Apply Online" title="Apply Online" src="/images/link.gif" height="16"/>&nbsp;
              <xsl:element name="a">
                <xsl:if test="./@newwindow = '1'">
                  <xsl:attribute name="target">_blank</xsl:attribute>
                </xsl:if>
                <xsl:choose>
                  <xsl:when test="./@type = 'external'">
                    <xsl:attribute name="href">
                      <xsl:value-of select="./@url"/>
                    </xsl:attribute>
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:attribute name="href">
                      <xsl:value-of select="umbraco.library:NiceUrl(./@url)"/>
                    </xsl:attribute>
                  </xsl:otherwise>
                </xsl:choose>
                <xsl:value-of select="./@link-title"/>
              </xsl:element>
            </li>
          </xsl:for-each>

     

    Thanks. Hope someone can help me,

    regards,

    Andy

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Jul 25, 2013 @ 18:03
    Chriztian Steinmeier
    1

    Hi Andy,

    Check this one out : urlpicker-helper on GitHub

    It's a file you can include - or you can grab the code to see how it's used...

    /Chriztian 

  • Andy Peiris 5 posts 55 karma points
    Jul 30, 2013 @ 11:48
    Andy Peiris
    100

    Hi Chriztian,

    thank you. I made an urlpicker-helper.xslt file.
    included in the script file and put this in place:

    <xsl:apply-templates select="additionalDocuments" mode="urlpicker" />

    This doesn't output the addionalDocuments items.
    Is there something I am missing or doing wrong?

    thanks,

    Andy

  • Andy Peiris 5 posts 55 karma points
    Aug 01, 2013 @ 11:18
    Andy Peiris
    0

    ok I found my mistake I should have done it like this:

    <xsl:apply-templates select="$currentPage/additionalDocuments" mode="urlpicker" />

  • Andy Peiris 5 posts 55 karma points
    Aug 01, 2013 @ 11:19
    Andy Peiris
    0

    Sorry, wanted to mark Chriztian's answer as the right one.

Please Sign in or register to post replies

Write your reply to:

Draft