Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

CQWP, custom ItemStyle.xsl and ContentQueryMain.xsl

  Asked By: Tessa    Date: Feb 02    Category: Sharepoint    Views: 8216

I have been trying to implement Brendon Schwartz's solution of using a
CQWP to point to a custom ItemSytle.xsl and ContentQueryMain.xsl

(Brendon's post can be found here:
and a very similar post by Liam Cleary can be found here:

I modified the webpart and uploaded it. The webpart's MainXslLink
property and its ItemXslLink property point to the 2 custom xsl sheets
in "/Style Library/XSL Style Sheets/" - My-ContentQueryMain.xsl and My-
ItemSytle.xsl, respectively.
Both the files are inheriting permission from the folder above (as do
the virgin ItemStyles and ContentQueryMain files). When I hit the page
with the new CQWP, it works fine (I was the one that uploaded the
files) for all users. After soon as the CacheXslTimeOut value expires,
users receive the oh so helpful "Unable to display this web part error"

Turning on verbose debugging for "Web Parts" shows a 401 unauthorized

It seems, as long I have accessed the page first, the xsl sheets are
cached, the web part works for all users.
If I changing the permission on the xsl sheets to - full for
authorized users, they can access the web part even when I haven't
cached it first..

What could be my problem? Assigning unique permission (full) to the
files is a workaround, but you can understand why I wouldn't want to
do that.

Why do my custom xsl require different permission in the same location
as the original xsl files?

Any thoughts?



4 Answers Found

Answer #1    Answered By: Karrie Wooten     Answered On: Feb 02

What differences do you see between the permissions on your new file(s) and
the permissions on ItemStyle.xsl? I'd guess that if you match those up
perfectly (perhaps just inheriting  from the permissions of the rest of the
12 hive), you should be good to go.

Then again, upon actually *reading* your post, it looks like you're not
placing these new files  in the 12 hive; any particular reason why not?

Answer #2    Answered By: Alan West     Answered On: Feb 02

The new files  are inheriting  permission from their parent just as the
ItemSyle.xsl is (the same parent).
I added them to the style  library because thats where the originals

So you are recommending I use a feature to deploy the files to
somewhere in the 12 hive? Maybe in the Layouts folder?

Answer #3    Answered By: Maribel Todd     Answered On: Feb 02

That's what I would instinctively recommend, though I haven't attempted this
yet. The ItemStyle.xsl and related files  are located in
12\TEMPLATE\FEATURES\PublishingResources , for what it's worth.

Answer #4    Answered By: Akshara Negalur     Answered On: Feb 02

I suspect you have come across a flaw in that technique. What those
guys have done is an "include" in the stylesheet, which is a neat
technique. However, it requires the code that is processing the
stylesheet to load another stylesheet file from the document
library. That code is probably generic XML/XSLT transform code that
wasn't written specifically for SharePoint, and just does an http
get of the stylesheet file.

My guess is that the technique will work in some situations (e.g.
Kerberos authentication with impersonation enabled by default, where
the end user's credentials are available) but not others (e.g. NTLM
authentication, with the two hop authentication issue).

This is just my guess, but based on what I have seen in some other
situations. A workaround would be to locate the included xslt file
somewhere it could be accessed anonymously.

Didn't find what you were looking for? Find more on CQWP, custom ItemStyle.xsl and ContentQueryMain.xsl Or get search suggestion and latest updates.