Developer forum

Forum » Templates » Data List - url that goes to another page

Data List - url that goes to another page

Lise T. Pedersen
Reply

I am building a data list template, and I would like the details to open on a different page - but I have problems with defining the ID tag in xslt, so that it will output the actual ID-number

I have tried something like

 

<a href="/Default.aspx?ID=1009&amp;mode=detail&amp;RowId=Tagwall_intranetID={Tagwall_intranetID.Value}&amp;ViewPID=1980"><!--DwTemplateTags-->
            <b><xsl:apply-templates select="Row.Value" /></b>
          </a>

 

I have tried a lot of different variations in defining the ID tag, which will be accepted in the xslt template - hope someone can help? (have also tried to write the correct link in html - convert it as xslt in the html-editor - but then it can not be saved as correct xslt??!?)

Hope some xslt-expert can find time to help...

Lise


Replies

 
Vladimir
Reply
This post has been marked as an answer

Hi Lise,

try to use such syntaxis:

 

          <a>
          <xsl:attribute name="href">
              /Default.aspx?ID=1009&amp;mode=detail&amp;RowId=<xsl:call-template name="findRowId"><xsl:with-param name="pText" select="Row.DetailUrl"/></xsl:call-template>
          </xsl:attribute>
            <b>
              <xsl:apply-templates select="Row.Value" />
            </b>
          </a>

 

and findRowId function:

  <xsl:template name="findRowId">
    <xsl:param name="pText" select="."/>
    <xsl:if test="string-length($pText)>0">
      <xsl:value-of select="substring-after($pText, 'RowId=')"/>
    </xsl:if>
  </xsl:template>


Best regards,
Vladimir

 

Votes for this answer: 1
 
Lise T. Pedersen
Reply

Works perfect - thank you!

 

You must be logged in to post in the forum