xslt - SharePoint 2010 Custom XSL View Rendering with Jquery and Ratings Field -


i'm developing sharepoint 2010 internet facing web site faq capabilities.

i've got custom list containing id, title (rennamed "question"), answer , fileds rating.

i writing xsl stylesheet in order customize list view rendering in following way:

  • faq items should displayed accordion, jquery
  • each faq rated users.

so, wrote xsl :

<xsl:stylesheet xmlns:x="http://www.w3.org/2001/xmlschema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt js" xmlns:ddwrt="http://schemas.microsoft.com/webparts/v2/dataview/runtime" xmlns:asp="http://schemas.microsoft.com/aspnet/20" xmlns:__designer="http://schemas.microsoft.com/webparts/v2/dataview/designer" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:sharepoint="microsoft.sharepoint.webcontrols" xmlns:js="urn:custom-javascript" >  <xsl:import href="/_layouts/xsl/main.xsl"/> <xsl:output method="html" indent="yes"/> <xsl:template match="/">  <script type="text/javascript" language="javascript" >         $(document).ready(function () {              $('#faqansweraccordion').accordion({                 autoheight: false,                 collapsible: true             });          });      </script>         <a id="top"></a>     <div id="faqansweraccordion">         <xsl:apply-templates select="//row" mode="item" />     </div> </xsl:template>  <xsl:template mode="item" match="row[../../@templatetype='100']">     <xsl:param name="fields" select="."/>     <xsl:param name="collapse" select="."/>     <xsl:param name="position" select="1"/>     <xsl:param name="last" select="1"/>     <xsl:variable name="thisnode" select="."/>      <h3 id="header_{@id}">         <a id="{@id}" href="#" ><xsl:value-of select="@title" disable-output-escaping="yes"/></a>     </h3>     <div>         <p>             <xsl:value-of select="@answer" disable-output-escaping="yes"/>         </p>         <p>             please rate faq:              <xsl:apply-templates select="$fields[@name='averagerating']" mode="printfield">                 <xsl:with-param name="thisnode" select="."/>                 <xsl:with-param name="position" select="$position"/>             </xsl:apply-templates>         </p>     </div> </xsl:template> 

with stylesheet, jquery accordion not generated, rating star present.

if replace following template definition

<xsl:template match="/"> 

by

<xsl:template match="view"> 

so, jquery accordion work fine, rating stars not.

any ideas ?

thank lot.

try changing mode number or body


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -