Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListXSL QuestionXSL Question
Previous
 
Next
New Post
5/25/2010 5:36 PM
 
I created a custom XSL to transform my FnL table, but I want to incorporate the Abbreviated URL feature from FnL Does anyone know what the XSL code is to trim a URL down to a file name? For example, to make this URL:

"http://www.dotnetnuke.com/Community/Forums/tabid/795/ctl/PostEdit/forumid/56/action/new/mid/2108/Default.aspx"

Display as "Default.aspx" or better yet "Default"

Thanks!
 
New Post
5/29/2010 2:14 PM
 
Since the FnL module doesn't yet support XSLT 2.0, we had to use this script. I'm posting this in the event there are others looking for similar solutions as I have noticed questions tend to repeat on this forum.

<xsl:template name="getFilename">
    <xsl:param name="input" />
    <xsl:choose>
      <xsl:when test="contains($input, '/')">
        <xsl:call-template name="getFilename">
          <xsl:with-param name="input" select="substring-after($input, '/')" />
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="substring-before($input, '.')" />
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

The call for that template is:

<td valign="top">
          <a href="{udt:FIELD}">
            <xsl:call-template name="getFilename">
              <xsl:with-param name="input" select="udt:FIELD" />
            </xsl:call-template>
          </a>
</td>

FIELD - is the column name in the table.
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListXSL QuestionXSL Question


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out