Avatar of MrNiss99
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
Microsoft SharePoint

Avatar of undefined
Last Comment
MrNiss99

8/22/2022 - Mon
SCHUMI33

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.
ItemStyle-NewV2.xsl
SCHUMI33

Note:  Rename the old ItemStyle.xsl.  You'll need to rename the attached new file to 'ItemStyle.xsl' and then run IISReset.
MrNiss99

ASKER
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....
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
SCHUMI33

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.
MrNiss99

ASKER
Hey SCHUMI33, I had applied the syle correctly.....
SCHUMI33

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.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
SCHUMI33

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
MrNiss99

ASKER
Added the webpart to the webpart gallary... No change, (see attached)...cheers,
CQWP-01.JPG
SCHUMI33

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.
SCHUMI33

This is the one.  Try importing and using this web part file.  Same as before.  Rename it.
Press-Releases-All.txt
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
MrNiss99

ASKER
I am going to close this as I havent really got what I needed... Thanks for the attempts though...