Copied to clipboard

Flag this post as spam?

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


  • Devin 87 posts 251 karma points
    Apr 25, 2013 @ 13:02
    Devin
    0

    XSLT NiceUrl - Link help

    Hi guys,

    I have a more button which you can see below. The only problem is, if there's a page using the same name then it doesn't link accordingly. Could I add the "company" variable to the link structure at the end? I think that would fix it. :)

    <xsl:variable name="id" select = "@id" />
    <xsl:variable name = "company" select = "company" />

    <h3><xsl:value-of select="@nodeName" /> ( <xsl:value-of select="$company"/> )h3>

      <xsl:if test="$moreButton != ''">
        <a href="{umbraco.library:NiceUrl(@id)}">morea>
      xsl:if>
  • Rich Green 2246 posts 4008 karma points
    Apr 25, 2013 @ 13:12
    Rich Green
    0

    Hey Devin,

    I think you might have something confused, if @id is a node id then there cannot be more than one node with the same name, so therefore it will be unique.

    Rich

  • Devin 87 posts 251 karma points
    Apr 25, 2013 @ 13:19
    Devin
    0

    Hey Rich,

    Take a look here.

    https://www.res-group.com/what-we-do/advisory-services/case-studies.aspx

    Carbon Reduction Strategy

    Carbon Reduction Strategy

    There are two case studies with the same name, but they each use the "company" field which is added onto the Title.

    <h3><xsl:value-of select="@nodeName" /> ( <xsl:value-of select="$company"/> )</h3>

    The 2nd case study doesn't link correctly because it uses the same name as the other case study.


  • Devin 87 posts 251 karma points
    Apr 25, 2013 @ 14:01
    Devin
    0

    Please delete this thread, I fixed it.

  • Rich Green 2246 posts 4008 karma points
    Apr 25, 2013 @ 14:22
    Rich Green
    0

    Hey Devin,

    It's more useful if you post your solution here and mark it as solved, so you might help others.

    Rich

  • Devin 87 posts 251 karma points
    Jun 13, 2013 @ 17:23
    Devin
    100

    Hello,

    It was a very easy solution. I just renamed the node names. :)

    Thanks,

    Devin

Please Sign in or register to post replies

Write your reply to:

Draft