Learn More About the Bamboo SharePoint Administration Suite

Custom style List Rotator does not work for lists

rated by 0 users
This post has 7 Replies | 4 Followers

Top 100 Contributor
Posts 3
Points 66
gmbx25 Posted: Thu, Aug 14 2008 1:49 AM

Unfortunately, the List Rotator web part, custom style does not work correctly if you have a normal list (Announcements, events). It only works if you attach the web part to a Picture Library. This is quite poor as I want to attach the web part to an Announcements list and rotate the content using custom styles... Also, a question: where is the List rotator getting the styles from, in case you use the styles presented? I tried Itemstyle.xsl, contentMain.xsl and I don't have these options... 

Thanks

Top 150 Contributor
Posts 2
Points 99

 Hi gmbx25,

You should be able to customize the style if you use a standard SP list. You can review this blog which explains how it can be done. http://community.bamboosolutions.com/blogs/bambooteamblog/archive/2008/05/02/how-to-configure-custom-style-in-the-list-rotator-web-part.aspx

Hope it helps!

 

 

Top 100 Contributor
Posts 4
Points 54
baldcat replied on Mon, Nov 10 2008 6:04 PM

 ok so the blog entry is ok, but pretty lite on for details..

Where are the default sytles ? like someone else wrote, I've also looked at the itemstyles.xsl etc and didn't have any luck..

I'm having also sorts of issues trying to get custom styles to work... and I'm find it incredibly frustrating fumbling around in the dark..

All I want to do it have a rotator that displays the contents of a list (NoticeBoard) Title, author description (trimed to 40 characters) and thumbnail..

I can't find any info on how to trim, or resize a picture..when ever I try to use examples straight from the itemstyles.xsl it errors out..

the OOTB style "Image on left" would work fine .. but do you think that works.....nope.

Top 10 Contributor
Posts 391
Points 9,229

baldcat,

I had to go to the Bamboo Engineering team for assistance with this one. Below is what they found.

**************************

Custom style still works well for lists. To create custom style, you need to clearly understand CSS. This is the simple example about custom style for anouncement list like you reported.
 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" />
<xsl:template match="rs_data">
<xsl:for-each select="z_row">
    <TABLE cellpadding="0" cellspacing="0" >
          <TR>
             <TD> <img class="cssImage"> <xsl:attribute name="src"><xsl:value-of select="@ows_pic"/></xsl:attribute> </img> </TD>
             <TD>
            <TABLE height="100%"  cellpadding="2px" cellspacing="0">
               <TR>
                 <TD class="cssTitle" >Title: </TD>
                 <TD> <xsl:value-of select="@ows_Title"/></TD>
               </TR>
               <TR>
                 <TD class="cssTitle" >Author: </TD>
                 <TD> <xsl:value-of select="@ows_Author"/></TD>
               </TR>
               <TR>
                 <TD class="cssTitle" >Description: </TD>
                 <TD> <xsl:value-of select="@ows_Body"/></TD>
               </TR>
            </TABLE>
            </TD>
        </TR>
    </TABLE>
</xsl:for-each> </xsl:template> </xsl:stylesheet>

 

 
You can resize a picture in CSS Edit button at .cssImage{border:10px;width:200px;height:200px;}
 
All of things such as @ows_pic, @ows_Title, @ows_Author,@ows_Body are parameters that are internal names of list columns. Please also make sure these columns are displayed in the view.

Please be sure you are using the correct column internal names as highlighted in yellow.

Chris Dooley
Community Manager

Top 100 Contributor
Posts 4
Points 54
baldcat replied on Wed, Nov 19 2008 4:58 PM

 Cheers for that

 

Ok cool I can understand that, but like the OOTB "Image of the left"

How do you go about linking the title back to the list entry, and the author to the person s profile page ?

Also to aid in presentaion, trimming the the Description (body) field would be needed.. Are you able to do this in CSS ?

The list rotator style (Boxed ,no labels)  works well,,, if only the image in it could be told to be a certain size,, Is there no way the default styles can be modified ?

 

Or can the Engineering Team fess up the XSL so can modify it myself :)

Top 10 Contributor
Posts 391
Points 9,229

Baldcat,

Here is more information from one of our engineers.

How do you go about linking the title back to the list entry, and the author to the person s profile page ?
You can use this method to make a hyperlink for any tag (<a>). You should then be able to play around to get the desired results.
 
<a>
<xsl:attribute name="href">www.yahoo.com</xsl:attribute>
<xsl:value-of select="@ows_LinkTitle"/>
</a>

 
Also to aid in presentation, trimming the Description (body) field would be needed.. Are you able to do this in CSS ?
This cannot be done in CSS. It will get all the characters that were entered in body field of Announcement list.

 
The list rotator style that shows the image works well,,, if only it could be told to be a certain size,, Is there no way the default styles can be modified ?
I am afraid that you cannot modify default styles.

Chris Dooley
Community Manager

Top 100 Contributor
Posts 4
Points 54
baldcat replied on Mon, Nov 24 2008 6:27 PM

 ok so thats cool that we can't edit the default styles, but how about the engineers post the XSL for the defualt styles then we can use this to build custom styles :)

 

Here's crossing fingers.. :)

Top 100 Contributor
Posts 4
Points 54
baldcat replied on Wed, Nov 26 2008 6:50 PM

Ok so getting somewhere... Below is what I have so far.. and it is looking good.. One thojng though,.,. Is there a way to the hide the image place holder if no image exsits ?

<TD class="ad" >
      <img src="{@ows_Picture}" width="100px" border="0" alt="{@ows_Picture}" />
      <xsl:value-of select="@ows_Advertisement"/>
     </TD>

 

 

 

<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" 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:ddwrt2="urn:frontpage:internal">
 <xsl:output method="html" />
 <xsl:template match="rs_data">
  <xsl:for-each select="z_row">
   <TABLE    height="100%"  cellpadding="0" cellspacing="0" class="cssTable">
    <TR>
     <TD class="cssBamboo1"  >
      <a href="/SearchCenter/Lists/Noticeboard/DispForm.aspx?ID={@ows_ID}">
       <xsl:value-of select="@ows_LinkTitle"/>
      </a>
     </TD>
     <TD class="user" >
      <a href="/searchcenter/Pages/peopleresults.aspx?k={@ows_Author}">
       <xsl:value-of select="@ows_Author"/>
      </a>
     </TD>
    </TR>
    <TR>
     <TD class="ad" >
      <img src="{@ows_Picture}" width="100px" border="0" alt="{@ows_Picture}" />
      <xsl:value-of select="@ows_Advertisement"/>
     </TD>
    </TR>
   </TABLE>
  </xsl:for-each>
 </xsl:template>
</xsl:stylesheet>

Page 1 of 1 (8 items) | RSS
  
Bamboo Solutions Corporation, 2002-2008