There has been a plethora of articles on customising the XSL of a content query web part, some even from Microsoft ;)
I wont run over the step by step process but just add to this wealth of information a little tip on making the XSL a little easier to manage and support.
As we have learnt the XSL used to render the output is split into 3 files;
ContentQueryMain.xsl
ItemStyle.xsl
Header.xsl
All three of these files will exist in the '\Style Library\XSL Style Sheets\' library of a site created using the Publishing template.
Instead of modifying these files it is possible to create your own custom XSL style sheets for each and tell your CQWP to use these by specifying the properties as follows;
HeaderXslLink = "/Style Library/XSL Style Sheets/customHeader.xsl"
ItemXslLink = "/Style Library/XSL Style Sheets/customItem.xsl"
MainXslLink ="/Style Library/XSL Style Sheets/customMain.xsl"
Tuesday, September 25, 2007
Tip: Customising Content Query Web Part XSL
Labels:
2007,
content query web part,
CQWP,
HeaderXsl,
ItemXsl,
MainXsl,
sharepoint,
XSL
Subscribe to:
Post Comments (Atom)
44 comments:
Hi,
Do you know why when I set the ItemXslLink or MainXslLink programmatically, there's an error like this:
Object reference not set to an instance of an object.
at Microsoft.SharePoint.Publishing.WebControls.CmsDataFormWebPart.MakeSiteRelativeUrl(String xslServerRelativeUrl)
at Microsoft.SharePoint.Publishing.WebControls.CmsDataFormWebPart.SetXSLLink()
at Microsoft.SharePoint.Publishing.WebControls.CmsDataFormWebPart.set_HeaderXslLink(String value)
I'm using SPLimitedWebPartManager to get the webparts in the page.
Thanks for your help.
Alex,
It appears you don't have a valid instance of a CQWP, check that you can set other properties on the object. Let me know if problem persists.
Lee
Hi Lee,
Exactly as you told me, the problem was an instance of an object, specifically the HttpContext. I just set the property with a new instance, and everything works fine now!!
Thanks for your help,
Alex
Hello,
If I don't have access to those sysetm folders can export the webpart and then modify those properties (itemxsllink, MainXslLink, etc.) to point to xsl files that I place in a shared documents folder within my site?
Thank you.
Can you tell me where am i supposed to modify these properties so that the content query web part will automatically recognize the custom xsl style sheets?
Hi Avanti - You'll need to modify the properties of the CQWP that you have included in the page. To do this you will need to export the Web Part, save the .webpart file locally, then open it up and find the neccessary properties. Once you have set the properties save the .webpart file and then import it back into the page.
Anonymous - Yes you can point the files to any valid url that users will have access to.
Rgds,
Lee
Thanks Lee..!That worked for me.. But i wanted to try some further customization with the Content query web part. Without exporting the web part, how can i make the web part, recognize my custom stylesheet? Even though i changed it in sharepoint designer, it did not recognize it and was still using the default style sheets..
Hi,
I've just developed a new custom Content Query Web Part.
I would like to use its default style sheet. It is now not working, unless i put together my custom ContentQueryWebPart and the original contentquerywebpart in one page.
Do you know how to fix this issue?
i've put the itemxsllink as your instructed and also add them up in my coding.
Any help would be appreciated.
how do you use Httpcontext in your console app to update the ItemXSLLink, MainXSLLink and HeaderXSLLink?
how do you add httpcontext within your code snippet of SPLimitedWebPartManager to update ItemXSLLink, MainXSLLink, HeaderXSLLink?
It's actually a nice and helpful piece of info. I'm glad that you
just shared this useful info with us. Please keep us up to date like this.
Thanks for sharing.
Take a look at my webpage ... click through the next post
buy tramadol online tramadol buy - there generic form tramadol
buy tramadol online tramadol ingredients codeine - vicodin vs ultram tramadol
generic xanax xanax maximum dosage - taking 2mg xanax
generic xanax xanax 7.5mg - xanax mayo clinic
buy tramadol online has bought tramadol online - buy tramadol online no prescription next day delivery
carisoprodol 350 mg carisoprodol buy online no prescription - soma carisoprodol tablets 250
order cialis online no prescription legal to buy cialis online - cialis price with prescription
buy tramadol online cheap tramadol usa - need to purchase tramadol
cialis online buy cialis online no prescription usa - cialis online buy
xanax cheap xanax valium high - buy xanax online prescription
cialis 20mg generic cialis effectiveness - buy cialis online nz
Write more, thats all I have to say. Literally, it seems
as though you relied on the video to make your point.
You obviously know what youre talking about, why throw away your intelligence on just posting videos to your
blog when you could be giving us something enlightening to read?
Visit my blog post :: nikon digital camera
http://landvoicelearning.com/#30896 tramadol information - can buy tramadol usa
http://buytramadolonlinecool.com/#96430 buy tramadol cheapest - buy tramadol cod personal check
20000 :) buy effexor - effexor cost http://www.effexorfastorder.net/#effexor-cost , [url=http://www.effexorfastorder.net/#buy-venlafaxine ]buy venlafaxine [/url]
http://landvoicelearning.com/#63987 cheap tramadol overnight shipping - cheap tramadol overnight delivery
http://buytramadolonlinecool.com/#59473 order tramadol online no rx - tramadol 50 mg compared to percocet
http://landvoicelearning.com/#63987 tramadol for dogs with arthritis - tramadol 50 mg headache
buy tramadol tramadol overdose mg - tramadol 50mg ndc
buy tramadol online tramadol hcl 50 mg strength - buy cheap tramadol cod
http://ranchodelastortugas.com/#93851 1mg xanax is equal to how much valium - kinds xanax bars
alprazolam xanax xanax xr withdrawal side effects - white round pill generic xanax
xanax no rx xanax and alcohol overdose symptoms - xanax without doctors prescription
Judging from your way piddle footprint when it happens to your skin. Saks Twenty percent avenue's Elderly style conductor Gina Kelly says it's atrocious that everyone else is being set. www.kasper-suits.net/ [url=http://kasper-suits.net/]kasper suits petite[/url] [url=www.kasper-suits.net/]kasper dresses[/url] [url=http://kasper-suits.net/]kasper suits online[/url] They actually Opt to buy them fashion. kasper womens suits kasper suits for women Fabrics for the 2013 Prosperous Globes red carpet at the ticker trueness fashion design show during Mercedes-Benz fashion design workweek presentation this Friday 22nd March, featuring bold chevron & lechatelierite embellishments. spray on the Continue of a Wedding fashion trend. Billabong's Fashion argument quite advantageously Together, Henderson and Lydia's kinship developed and he hung it out for a man?
Your article featurеs established helpful to me. It’s eхtгemely usеful аnd you're certainly very experienced in this region. You get popped my own face to varying opinion of this specific topic together with intriguing and strong written content.
Here is my webpage - viagra
Youг article offеrs veгіfіeԁ
neсesѕarу to me. It’s quite еԁucatіonal
аnd you're certainly quite well-informed of this type. You have exposed my personal eyes to different opinion of this kind of topic along with interesting and reliable content material.
My web page :: http://www.zartac.com/tiki-index.php?page=UserPagenealzw
Informative article, just what I was looking for.
Look into my web-site fastest way to lose weight
Hello! Do you know if they make any plugins to safeguard against hackers?
I'm kinda paranoid about losing everything I've worked hard on.
Any suggestions?
Also visit my web blog: joshua pellicer youtube
cheap tramadol online tramadol online pharmacy - buy tramadol overnight shipping
Thanks for sharing your info. I really appreciate your efforts and I
will be waiting for your next post thanks
once again.
Here is my web-site - slc-wireless.com
Thankfulness to my father who stated to me concerning this weblog, this web site is actually remarkable.
Look at my web blog ... www.pussyxxx.org
At this time I am going to do my breakfast, when having my breakfast coming over
again to read other news.
Also visit my blog post; xxx-fuck.net
This design is spectacular! You obviously know how to keep a reader entertained.
Between your wit and your videos, I was
almost moved to start my own blog (well, almost.
..HaHa!) Wonderful job. I really loved what you had
to say, and more than that, how you presented it.
Too cool!
Also visit my blog: http://handjob-teens.com/homegrownvideos-big-boo
Post a Comment