Copied to clipboard

Flag this post as spam?

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


  • Ralph van Vugt 57 posts 101 karma points
    Jun 04, 2010 @ 12:25
    Ralph van Vugt
    0

    Show ID from dropdown list

    I 've created a docType with a dropdown-field in which the user can select a "genre". The dropdown is a dataType. In XSLT I can sort the pages on genre, but it shows all the genres in a long list.

     

    <xsl:for-each select="./node/node[@nodeTypeAlias = 'ccAct']">
    <xsl:sort order="ascending" select="data [@alias = 'ccGenre']"/>
    <xsl:value-of select="data [@alias = 'ccGenre']"/>

    ...

    Is it possible to show only a certain ID?

    Thanks,

    Ralph

     

     

  • Rich Green 2246 posts 4008 karma points
    Jun 04, 2010 @ 12:42
    Rich Green
    0

    Hi Ralph,

    Yes, it's possible.

    Your XSLT currently is doing exactly what you are asking it to do, list all the ccAct nodes sorted by ccGenre

    I don't think you need to loop through the Genres on your display page, you just need to show the genre that the user selected in the umbraco back end for that doc type right?

    To keep it easy you could use the XSLT that you have above however you need to add an IF statement to only show the genre which relates to the page you are on.

    In puesdo code

    <xsl:for-each select="./node/node[@nodeTypeAlias = 'ccAct']>
    If the current page genre = the genre in the loop then  display genre otherwise don't display anything </xsl:for-each>

     

    Best of luck

    Rich

     

     

  • Ralph van Vugt 57 posts 101 karma points
    Jun 04, 2010 @ 13:24
    Ralph van Vugt
    0

    Thanks Rich, I'll give it a try!

  • Rich Green 2246 posts 4008 karma points
    Jun 04, 2010 @ 15:46
    Rich Green
    0

    Best of luck, post back if you can't get it working.

     

Please Sign in or register to post replies

Write your reply to:

Draft