Icon Settings

Icon Settings

Sitecore Icon Configuration Settings

  • Icons Cache Folder
  • Use Zipped Icons
  • Default Icon

Icons Cache Folder

  • A setting in the web.config file that specifies the folder to use for caching icons
  • Only applies when icons are stored in zip files
  • The specified relative path must point to a folder below the webroot
  • The default value is: /temp/IconCache

Use Zipped Icons

  • Indicates whether to use icons stored in zip files
  • If you set this to false, all icons must be available as physical files
  • Default value: true
  • Unzipping the zipped icon files creates a nested icon category folder structure
    • Remove the outer category folder after unzipping the icon files
    • Unzipped category folders should be stored below /sitecore/shell/Themes/Standard
    • Right: /sitecore/shell/Themes/Standard/Applications/16x16
    • Wrong: /sitecore/shell/Themes/Standard/Applications/Applications/16x16

Default Icon

  • The icon from the data template associated with the item is displayed when an item does not have an icon specifically assigned to it
  • The icon assigned to DefaultIcon is displayed when an item and its data template do not have an icon assigned to them

Controls featured in this example:

  • Sitecore Web Control

Classes featured in this example:

  • Sitecore.Configuration.Settings
  • Sitecore.Configuration.Settings.Icons
  • Sitecore.Context
  • Sitecore.Data.Items.Item

Configuration Settings

<configuration>
<sitecore>
<icons>
       <sc.include file="/App_Config/Icons.config" />
     </icons> 


<configuration>
<sitecore>
<settings>
<setting name="DefaultIcon" value="/sitecore/shell/themes/Standard/Applications/32x32/Document.png" />
<setting name="Icons.CacheFolder" value="/temp/IconCache" />
<setting name="Icons.UseZippedIcons" value="true" />


<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="sitecore_icon.ashx" type="Sitecore.Resources.IconRequestHandler, Sitecore.Kernel" />


output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Div);
output.Write("C# Web Control Real-time Output");
output.RenderEndTag();

output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-size:x-small; width:100%; clear:both");
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Div);
output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-weight:bold");
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.P);
//using &#58; for colon and &#160; for space
output.Write("{0}&#58;&#160;{1}", "Item", item.DisplayName);
output.RenderEndTag(); //P

output.Write("{0}&#58;&#160;{1}", "Default Icon", "<b>" + Sitecore.Configuration.Settings.DefaultIcon + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Icon Cache Folder", "<b>" + Sitecore.Configuration.Settings.Icons.CacheFolder + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Use Zipped Icons", "<b>" + Sitecore.Configuration.Settings.Icons.UseZippedIcons.ToString() + "</b>");

output.RenderEndTag(); //Div

C# Web Control Real-time Output

Item: Icon Settings

Default Icon: /sitecore/shell/themes/Standard/Applications/32x32/Document.png
Icon Cache Folder: /temp/IconCache
Use Zipped Icons: True - See more at: http://tic66/en/Developers/ContentDisplay/IconManagement/IconSettings#sthash.PwUnVVpy.dpuf



Sources