Knowledge Walls
Gopal Rao
Mumbai, Maharashtra, India
Passcode:
How to show the icon of the content for sharepoint document library content through xsl
2084 Views
Introduction 
To show the Icon of the content ....Its has to be there in server at location of /_layouts/images/ . If the icon not there you can store in that location in different ways.By default also it will have some icon. Here i am going to discuss about how to get the icon for related content like word content , excel ,pdf etc..,

For that use the internal name of 
HTML_x005F_x0020_File_x005F_x0020_Type,File_x005F_x0020_Type.
Syntax
//By using img tag you can get the image of icon and also using ddwrt.
<img src="/_layouts/images/{ddwrt:MapToIcon(string(@HTML_x005F_x0020_File_x005F_x0020_Type),string(@File_x005F_x0020_Type))}" alt="{@DocIcon}" />
Note 
Dont forget to refer the ddwrt in the stylesheet.
<xsl:stylesheet 
  version="1.0" 
  xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime">

 
Best Lessons of "Sharepoint(MOSS) XSLT codes"
Top lessons which are viewed more times.
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details