Default icons in Download List
I want to make default icons in the Download List control so that pdf files have the same icon, word files have another icon etc (please notice that I don't want thumbnails or custom icons, just generic icons based on the file type)...
I've noticed that the admin section for the Documents & files module does this already as shown in this pic http://img691.imageshack.us/img691/5157/sanstitrezipf.png
So I suppose there is a way to change the Download List template to achieve this behavior (I tried the thumbnail field without success).
Otherwise, what would be the best way to achieve this.
Thank you.
Hello martani,
The DownloadListView control shows the icons by default. Please drop the control on a page and you should see these icons.
Best wishes,
Ivan Dimitrov
the Telerik team
Hi,
Actually there are no icons shown on the Download list. I made sure that the "display icons" option is selected in the setting but nothing is shown, on the List type as well as the Table type.
When I click Edit Thumbnail list template on the Table type for example is have this :
<%@ Control Language="C#" %>
<%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %>
<%@ Register TagPrefix="sitefinity" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.PublicControls.BrowseAndEdit" Assembly="Telerik.Sitefinity" %>
<
sf:BrowseAndEditToolbar
ID
=
"browseAndEditToolbar"
runat
=
"server"
Mode
=
"Edit"
></
sf:BrowseAndEditToolbar
>
<
telerik:RadGrid
id
=
"documentsGrid"
runat
=
"server"
CssClass
=
"sfdownloadTable sfTableMode"
skin
=
"Sitefinity"
>
<
ClientSettings
EnableRowHoverStyle
=
"false"
EnableAlternatingItems
=
"false"
/>
<
PagerStyle
Mode
=
"NumericPages"
/>
<
MasterTableView
PageSize
=
"50"
EnableNoRecordsTemplate
=
"true"
>
<
Columns
>
<
telerik:GridBoundColumn
UniqueName
=
"title"
HeaderText="<%$ Resources:Labels, File %>" DataField="Title" ItemStyle-CssClass="sfdownloadTitle" HeaderStyle-CssClass="sfdownloadTitle" />
<
telerik:GridBoundColumn
UniqueName
=
"documentType"
HeaderText="<%$ Resources:Labels, Type %>" DataField="Extension" ItemStyle-CssClass="sfdownloadType" HeaderStyle-CssClass="sfdownloadType" />
<
telerik:GridBoundColumn
UniqueName
=
"totalSize"
HeaderText="<%$ Resources:Labels, Size %>" DataField="TotalSize" ItemStyle-CssClass="sfdownloadSize" HeaderStyle-CssClass="sfdownloadSize" />
<
telerik:GridBoundColumn
UniqueName
=
"uploadedOn"
HeaderText="<%$ Resources:Labels, UploadedOn %>" DataField="DateCreated" DataFormatString="0:dd MMM, yyyy" ItemStyle-CssClass="sfdownloadDate" HeaderStyle-CssClass="sfdownloadDate" />
<
telerik:GridTemplateColumn
UniqueName
=
"templateColumn"
HeaderText="<%$ Resources:Labels, Download %>"
ItemStyle-CssClass="sfdownloadCell" HeaderStyle-CssClass="sfdownloadCell">
<
ItemTemplate
>
<
sitefinity:SitefinityHyperLink
ID
=
"documentLink"
Text="<%$ Resources:Labels, Download %>" runat="server" CssClass="sfdownloadLink" target="_blank" />
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
<
NoRecordsTemplate
>No documents found!</
NoRecordsTemplate
>
</
MasterTableView
>
</
telerik:RadGrid
>
<
sitefinity:Pager
id
=
"pager"
runat
=
"server"
></
sitefinity:Pager
>
Hello martani,
I am not able to replicate this issue with the same template. The icon is resolved if you have "sfdownloadLink" class. Can you observe the page HTML and see whether something blocks the css?
All the best,
Ivan Dimitrov
the Telerik team
Hi,
I've been doing some testing, and I've found that the icons show up normally when I don't use any template for my page.
When I use my template (with a defined theme), the resources.axd returns the section
/* START Telerik.Sitefinity.Resources.Themes.Default.Styles.BrowseAndEdit.css */
...
/* END Telerik.Sitefinity.Resources.Themes.Default.Styles.BrowseAndEdit.css */
Hello martani,
I have not seen this issue before. You can open a bug report and send the template and your theme, so we could see what the actual problem is.
Kind regards,
Ivan Dimitrov
the Telerik team
Same goes for me. Testing - even on a blank template, the Table type doesn't show the icons.
The Table with Details type shows the icons properly.
Found it - the Table type template is missing:
<sitefinity:ResourceFile Name="Telerik.Sitefinity.Resources.Themes.Basic.Styles.icons.css" Static="true" />
</sitefinity:ResourceLinks>
Add that to the top and it works!
Update: It didn't actually work - however when I restored the template to default, it brought in the above code. In table view it now shows the icons properly
Hello Matt,
Ok, please attache several screeenshots in case the problem still persists for you so we can made some local tests and see what the problem could be.
Best wishes,
Ivan Dimitrov
the Telerik team