SharePoint XSL

I have a business data list that pulls info from External Content List (SQL).  I have one field that displays an email address.  I would like for users to be able to click on the email text and enter a mailto function.  I am unsure what to edit and how to edit the XSL format.

Here is the section of the XSL that probably needs to be edited:

Direction is appreciated.
<td class="ms-vb">
        <xsl:attribute name="style">
          <xsl:choose>
            <xsl:when test="$dvt_1_form_selectkey = @*[name()=$ColumnKey]">color:blue</xsl:when>
            <xsl:otherwise />
          </xsl:choose>
        </xsl:attribute>
        <xsl:variable name="fieldValue">
          <xsl:call-template name="LFtoBR">
            <xsl:with-param name="input">
              <xsl:value-of select="@primaryEmail" />
            </xsl:with-param>
          </xsl:call-template>
        </xsl:variable>
        <xsl:copy-of select="$fieldValue" />
      </td>

Open in new window

LVL 1
ICGAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gertone (Geert Bormans)Information ArchitectCommented:
<xsl:template name="mail">
  <xsl:param name="input"/>
  <a href="mailto:{$input}>
    <xsl:value-of select="$input"/>
  </a>
</xsl:template>

and call like this

          <xsl:call-template name="mail">
            <xsl:with-param name="input">
              <xsl:value-of select="@primaryEmail" />
            </xsl:with-param>
          </xsl:call-template>

instead of

          <xsl:call-template name="LFtoBR">
            <xsl:with-param name="input">
              <xsl:value-of select="@primaryEmail" />
            </xsl:with-param>
          </xsl:call-template>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ICGAuthor Commented:
@Gertone: Solution ended up being similiar to what you said, but your solution did not quite work (not sure if SP or something else).  I added mailto field through SharePoint designer and customized XSL code accordingly.

I posted template below.
<xsl:param name="input"/>
  <a href="mailto:{@Email}?subject=Happy Birthday"><xsl:value-of select="@Email" /></a>
</xsl:template>

Open in new window

0
ICGAuthor Commented:
Thanks for the help, Gertone.
0
Gertone (Geert Bormans)Information ArchitectCommented:
Well, this has nothing to do with the version of SP,
you are simply not passing the correct value to the template as a parameter
and you are using the attribute of the context node, which is just fine

but drop this line then
<xsl:param name="input"/>
you ar not using it

cheers
0
ICGAuthor Commented:
Gertone's solution was almost perfect, but template needed a little adjusting to work in SP2010.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SharePoint

From novice to tech pro — start learning today.