Software Support Forum


Research answers to your questions, or request support for SharePoint
Solutions software products. Our forums are grouped by software product.
Welcome to Software Support Forum Sign in | Join | Help
in Search

Customizing the default Alert Details' XSL Transformation

Last post 12-10-2008 11:30 AM by davidfisher. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 08-13-2008 2:37 AM

    Customizing the default Alert Details' XSL Transformation

    A quick question about the Alert Details' XSL Transformation, this is solely tied to the Global Token {AlertDetailsTable}, right? If the answer is yes, is there a way to customize the default Alert Details' XSL Transformation? I have tried editing minor details in it and every time I change a single character in there it kills the whole Alert Details Table.

     What I am trying to do is just remove the "Modify my alerts settings" and "Mobile View" links. These links, for us, are unnecessary to be there since we are using SharePoint groups for the alerts and the alert will not be associated with their login; and mobile views are deactivated at the moment.

    Any light you could shed on this subject would be really appreciated.

    Thank you,
    Shadowlo

  • 08-15-2008 3:02 PM In reply to

    Re: Customizing the default Alert Details' XSL Transformation

    Yes, the Alert Details XSL Transformation is what generates the html for the {AlertDetailsTable} token. You may edit as you like to get the desired layout. 

    I believe this is what you are looking for. It includes everything but the "Modify my alerts settings" and "Mobile View" links.

    AlertDetailsTable

    Here is the transform: 

     <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method="html"/>
      <xsl:param name="SiteAbsoluteUrl"/>
      <xsl:param name="WebAbsoluteUrl"/>
      <xsl:param name="WebTitle"/>
      <xsl:param name="ListAbsoluteUrl"/>
      <xsl:param name="ListTitle"/>
      <xsl:param name="ItemAbsoluteUrl"/>
      <xsl:param name="ItemTitle"/>
      <xsl:param name="MobileAbsoluteUrl"/>
      <xsl:param name="ItemDisplayFormAbsoluteUrl"/>
      <xsl:param name="EventDescription"/>
      <xsl:param name="WebLink"/>
      <xsl:param name="ListLink"/>
      <xsl:template match="/">
        <table class="content" cellspacing="0" cellpadding="0">
          <tr>
            <td colspan="3">
              <table class="toolbar" cellspacing="0" cellpadding="0" width="100%">
                <tr>
                  <td>
                    <table cellspacing="0" cellpadding="0" border="0">
                      <tr>
                        <td class="toolbarbutton">
                          <xsl:element name="a">
                            <xsl:attribute name="href">
                              <xsl:value-of select="$ItemDisplayFormAbsoluteUrl"/>
                            </xsl:attribute>
                            View Item
                          </xsl:element>
                        </td>
                        <td class="toolbarsep">|</td>
                        <td class="toolbarbutton">
                          <xsl:element name="a">
                            <xsl:attribute name="href">
                              <xsl:value-of select="$ListAbsoluteUrl"/>
                            </xsl:attribute>
                            View&#160;<xsl:value-of select="$ListTitle"/>&#160;List
                          </xsl:element>
                        </td>
                        <td class="toolbarsep">|</td>
                        <td class="toolbarbutton">
                          <xsl:element name="a">
                            <xsl:attribute name="href">
                              <xsl:value-of select="$WebAbsoluteUrl"/>
                            </xsl:attribute>Visit&#160;<xsl:value-of select="$WebTitle"/>&#160;Web
                        </xsl:element>
                        </td>
                      </tr>
                    </table>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
          <tr>
            <td colspan="3" class="spacer">&#160;</td>
          </tr>
          <xsl:apply-templates/>
        </table>
      </xsl:template>
     
      <xsl:template match="Fields/Field">
        <xsl:if test="(not(@Hidden) or @Hidden='false') and not(starts-with(@Name,'_'))">
          <tr>
            <td class="formlabel">
              <xsl:choose>
                <xsl:when test="not(@DisplayName)">
                  <xsl:value-of disable-output-escaping="no" select="mailto:./@Name%22/>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:value-of disable-output-escaping="no" select="mailto:./@DisplayName%22/>
                </xsl:otherwise>
              </xsl:choose>
            </td>
            <td class="formbody">
              <xsl:choose>
                <xsl:when test="not(@LookupOldF)">
                  <xsl:choose>
                    <xsl:when test="not(@Old)">
                      &#160;
                    </xsl:when>
                    <xsl:otherwise>
                      <!--<xsl:value-of disable-output-escaping="no" select="mailto:./@Old%22/>-->
                      <xsl:value-of disable-output-escaping="yes" select="mailto:./@Old%22/>
                    </xsl:otherwise>
                  </xsl:choose>
                </xsl:when>
                <xsl:otherwise>
                  <!--<xsl:value-of disable-output-escaping="no" select="mailto:./@LookupOldF%22/>-->
                  <xsl:value-of disable-output-escaping="yes" select="mailto:./@LookupOldF%22/>
                </xsl:otherwise>
              </xsl:choose>         
            </td>
            <td class="altvb">
              <xsl:choose>
                <xsl:when test="not(@LookupNewF)">
                  <xsl:choose>
                    <xsl:when test="not(@New)">
                      &#160;
                    </xsl:when>
                    <xsl:otherwise>
                      <!--<xsl:value-of disable-output-escaping="no" select="mailto:./@New%22/>-->
                      <xsl:value-of disable-output-escaping="yes" select="mailto:./@New%22/>
                    </xsl:otherwise>
                  </xsl:choose>
                </xsl:when>
                <xsl:otherwise>
                  <!--<xsl:value-of disable-output-escaping="no" select="mailto:./@LookupNewF%22/>-->
                  <xsl:value-of disable-output-escaping="yes" select="mailto:./@LookupNewF%22/>
                </xsl:otherwise>
              </xsl:choose>
            </td>
          </tr>
        </xsl:if>
      </xsl:template>
    </xsl:stylesheet>

     

    You could also replace the first template tag with the following to eliminate the link headers all together:

      <xsl:template match="/">
        <table class="content" cellspacing="0" cellpadding="0">
          <xsl:apply-templates/>
        </table>
      </xsl:template>

    David Fisher
    Software Engineer
    SharePoint Solutions
  • 08-22-2008 8:34 AM In reply to

    Re: Customizing the default Alert Details' XSL Transformation

    Thanks David... this helped alot...

     S

  • 11-12-2008 1:17 PM In reply to

    Re: Customizing the default Alert Details' XSL Transformation

    Where in the 12-hive does this file reside?

     Thanks

  • 11-12-2008 5:03 PM In reply to

    Re: Customizing the default Alert Details' XSL Transformation

    Please disregard, I found it in Central Admin.

     Thanks

  • 12-09-2008 10:37 PM In reply to

    Re: Customizing the default Alert Details' XSL Transformation

     I can't find in Central Admin.  I want to have auto generated url in alerts include the IP rather than the server-name and this seems the best place to do it.  Can I get a path to the file? 

    Thanks.

    Ray 

  • 12-10-2008 9:42 AM In reply to

    Re: Customizing the default Alert Details' XSL Transformation

    Each custom alert template has it's own Xsl transform. You can find them in Central Administration by clicking on 'Manage Alert Templates' on the Application Management tab, then choosing edit for the appropriate custom template. There will be a link on the Manage Alert Template page for 'Alert Detail's XSL Transform'.

    The auto generated urls come from within SharePoint which only knows the web applications by their friendly url, not by IP address unless you initially create the web application using the IP address.

    David Fisher
    Software Engineer
    SharePoint Solutions
  • 12-10-2008 10:30 AM In reply to

    Re: Customizing the default Alert Details' XSL Transformation

    Thanks David. I'm on Sharepoint Services 3.0 and Windows Server 2003 SP2. I don't have the "Manage Alert Templates" in Central Admin. My menu options are as follows: SharePoint Web Application Management Create or extend Web application Remove SharePoint from IIS Web site Delete Web application Define managed paths Web application outgoing e-mail settings Web application general settings Content databases Manage Web application features Web application list Application Security Security for Web Part pages Self-service site management User permissions for Web application Policy for Web application Authentication providers Workflow Management Workflow settings SharePoint Site Management Create site collection Delete site collection Site use confirmation and deletion Quota templates Site collection quotas and locks Site collection administrators Site collection list SharePoint Site Management Create site collection Delete site collection Site use confirmation and deletion Quota templates Site collection quotas and locks Site collection administrators Site collection list External Service Connections Records center HTML viewer Document conversions I've looked inside all the obvious but can't see anything that resembles an Alert Template. Any way to identify and access the xsl file directly? Thanks for the info on friendly url vs IP.
  • 12-10-2008 11:30 AM In reply to

    Re: Customizing the default Alert Details' XSL Transformation

    You must have Alert Manager installed and activated on a content web application for this option to be available in Central Administration which is the only place you will be able to find and edit the XSL Transforms.

    David Fisher
    Software Engineer
    SharePoint Solutions
Page 1 of 1 (9 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems