Link to home
Create AccountLog in
Avatar of MrNiss99

asked on

Custom Item Stlyle (Itemstyle.xsl)

We have started using content query web parts to display our intenal news/announcments via audience targets. Our existing webpart display the news items on our front page in the following way:-

*Image displayed on the left
*Tittle in the middle
*Date created on the top right

I have tried using the default views for the CQWP provided out of the box but cannot get the content query to display anything but the title. I have read some article on how to customise the itemstyle.xsl but still dont quite understand what exact code I need to add to the itemstyle.xsl....Thanks in advance
Avatar of SCHUMI33
Flag of United Kingdom of Great Britain and Northern Ireland image

Before you go making any changes to the itemstle.xsl, back it up.  I've played around with the CQWP before and included a marquee scroller and fixed size images, different style titles etc etc.  

I've attached one of mine here.  Download it and have a look.  Hope it helps.
Note:  Rename the old ItemStyle.xsl.  You'll need to rename the attached new file to 'ItemStyle.xsl' and then run IISReset.
Avatar of MrNiss99


hey SCHUMI33,
      thanks for that, I have tested your ItemStyle.xsl but it still doesnt display the images. I get the title & creation date but none of the images are displayed....
Go into 'Modify Shared Web Part' for the CQWP.  Under the style tab expand it.  Then select the option "AnnouncementiwthImage&Body" Under the 'Item Style' heading.
Hey SCHUMI33, I had applied the syle correctly.....
I noticed I didn't attach the webpart file.  I thought I had as well as the ItemStyle.xsl.  I am at home at the moment.  I'll post the web part file in the morning.  Cheers.
Avatar of SCHUMI33
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Added the webpart to the webpart gallary... No change, (see attached)...cheers,
I've gotta test something.  I haven't forgotten about your question.  Bear with me as I have to do it in my own time (lunch break etc) whilst in work.
This is the one.  Try importing and using this web part file.  Same as before.  Rename it.
I am going to close this as I havent really got what I needed... Thanks for the attempts though...