0

I have a big issue and a question about CQWP and slider. I have an image library which will serve as a news library. I've set a CQWP on my homepage which will display Image, title and comments columns, and give the proper url link.

So, first, the question : how to know which column name should i use? I don't ge thow to use the column names in xsl templates.

Because for the comments, i wrote in my ItemStyle.xsl :

<xsl:variable name="DisplayDesc"><xsl:value-of select="@Comments"/></xsl:variable>
<!-- some more code for displaying title...-->
<b><xsl:value-of select="$DisplayDesc" disable-output-esacping="yes"/></b>

And nothing of my comment is displayed.

Now, i have a serious issue :

i've used Flexslider to set up my slideshow. For the moment, i have only two images to show, Image1, and Image2. But my slider displays in order : Image1,Image2,Image1 and a blank slide.

I don't know where this come from, either why Image1 is cloned.

here is my html output, copied on IE developper tool : HTML output from IE developper tool

Here are the code i've used : To launch flexslider :

$('.flexslider').flexslider({
  animation:"slide",
  controlNav:false,
  prevText:"précédent",
  nextText:"suivant",
  minItems:1,
  maxItems:20,
  itemWidth:400
});

My custom template, which i've declared in myItemStyle.xsl

<xsl:template name="HomePage-Slider" match="Row[@Style='HomePage-Slider']" mode="itemstyle">

<xsl:variable name="SafeLinkUrl"><xsl:call-template name="OuterTemplate.GetSafeLink"><xsl:with-param name="UrlColumnName" select="'LinkUrl'"/></xsl:call-template></xsl:variable>
<xsl:variable name="SafeImageUrl"><xsl:call-template name="OuterTemplate.GetSafeStaticUrl"><xsl:with-param name="UrlColumnName" select="'ImageUrl'"/></xsl:call-template></xsl:variable>
<xsl:variable name="DisplayTitle"><xsl:call-template name="OuterTemplate.GetTitle"><xsl:with-param name="Title" select="@Title"/><xsl:with-param name="UrlColumnName" select="'LinkUrl'"/></xsl:call-template></xsl:variable>
<xsl:variable name="DisplayDesc"><xsl:value-of select="@Comments"/></xsl:variable>

<li>
<a href="{$SafeLinkUrl}">
<xsl:if test="$ItemsHaveStreams = 'True'"><xsl:attribute name="onclick"><xsl:value-of select="@OnClickForWebRendering"/></xsl:attribute></xsl:if>
<xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'"><xsl:attribute name="onclick"><xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/></xsl:attribute></xsl:if>
<img src="{$SafeImageUrl}" title="{@DisplayTitle}">
<xsl:if test="$ImageWidth != ''"><xsl:attribute name="width"><xsl:value-of select="$ImageWidth" /></xsl:attribute></xsl:if>
<xsl:if test="$ImageHeight != ''"><xsl:attribute name="height"><xsl:value-of select="$ImageHeight" /></xsl:attribute></xsl:if>
</img>
</a>
<p class="flex-caption">
<!--<xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>-->
<b><xsl:value-of select="$DisplayTitle"/></b>
<b><xsl:value-of select="$DisplayDesc" disable-output-escaping="yes"/></b>
</p>
</li>
</xsl:template>

Could you help me with these please? I'm quite desperate at this point..

  • Answer to your first question is: You need to consider Static name of the column name in the XSL file. For Second Issue: Have you checked that any empty item is there on the list? without any image? As far as I know flexslider automatically render two extra li elements with class clone, and it is appearing on the your given DOM. It seems that your display template is being called more than one time. – Pradip R. Jan 19 '15 at 12:03
  • Thanks for the answer, @Pro.. ! For the first question, How do i know/discover this static name? I can't install CAMLQuery helper on my client's device... Second issue : I have only two items in my image library, and these are filled both with an image... Do you think the "clone" items will disappear if i add more items? Maybe for the preoper rendering, i have to use 4 at minima... But there's nothing on Flexslider's doc... – Gaelle Jan 19 '15 at 12:59
  • First: when you edit column by going into list settings and edit column. You will find querystring Field, the value of it is considered as a static name. Second: clone will automatically appear when the flexslider jquery plugin will initialize. There should be no matter of item count. Also check you have not given SharePoint class dfwp-item in li element, though it is rendering. So it might be the case that some other template is being called as well. – Pradip R. Jan 19 '15 at 13:14
  • First : i found it myself finally, but thanks again for confirmation. (was helped by [link]social.msdn.microsoft.com/Forums/sharepoint/en-US/… ) The column is "_Comments" and not "Comments" as i wrote. Second: thanks for the clues, i'll check on it! You're really helpful @Pro.. ! – Gaelle Jan 19 '15 at 13:17
  • Welcome Gaelle! I am Glad, you are getting your solution! – Pradip R. Jan 19 '15 at 13:23
0

Might be there is some special or html markup to default Title. I have seen you have written disable-output-escaping='yes'. But it is not working for special characters. You have to write code to remove these special symbols and html tags.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.