0

Using the design manager to create a content query webpart snippet. I'm using the Document with using the Title, description and document icon item style for the presentation. It is working and showing the correct results on my page. Yay!

The format is showing the small document type icon, for example:

<img class="image" src="/_layouts/15/IMAGES/icjpg.gif" title="">

I want to change the file from the small icon icjpg.gif to the large version lg_icjpg.gif.

I found this tutorial on how to customize the ItemStyle.xsl file for the template. And I see changes, for example, adding a class or tag, I make to the xsl file reflected in my renders CQWP.

In the .xsl file I see the part the creates the img tag and it looks like this:

<img class="image" src="{@DocumentIconImageUrl}" title="" />

The part in the curly braces is what resolves to the path and filename for the image. I don't know how to edit the value returned by {@DocumentIconImageUrl}.

But I'm not sure if this is where I need to change that. Perhaps that comes from the snippet. So I looked in there to see if it was sending which image to use. I'm not sure, but in the data mapping view fields I see this:

{94f89715-e097-4e8b-ba79-ea02aa8b7adb},Lookup;
{543bc2cf-1f30-488e-8f25-6fe3b689d9ac},Image;
{fa564e0f-0c70-4ab9-b863-0177e6ddd247},Text;
{d27857ae-a919-44e1-8703-708f7a4b8158},Text;"

I see the guid starting fa56... is for the Title field and d278... is a Caption field I added to the content type. Both of which are what I'm having show in my item display.

So I assume the image line is for a field that tells SP the icon to use, but I can't locate it or find a way to change it to lg icon.

So is there a way to tell the snippet to use the large icon? Or is there a way in the .xsl file to keep the image path and manipulate the filename to add the lg_ prefix?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.