1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Default icons in Download List

Default icons in Download List

9 posts, 0 answered
  1. martani
    martani avatar
    27 posts
    Registered:
    24 Jan 2011
    14 Feb 2011
    Link to this post
    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.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    15 Feb 2011
    Link to this post
    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
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. martani
    martani avatar
    27 posts
    Registered:
    24 Jan 2011
    15 Feb 2011
    Link to this post
    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>

    Thank you
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    16 Feb 2011
    Link to this post
    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
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. martani
    martani avatar
    27 posts
    Registered:
    24 Jan 2011
    17 Feb 2011
    Link to this post
    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 */

    But without any of the .sfdownloadFileWrp, .sfdownloadLink, .sfpdf... defined! 

    I copied the generated CSS from the axd file from the empty template to my css, and the icons now show up.

    I wonder if the custom theme is making the axd file not generating these parts of the CSS!
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    17 Feb 2011
    Link to this post
    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
  7. MNP
    MNP avatar
    79 posts
    Registered:
    23 Apr 2008
    02 Mar 2011
    Link to this post
    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.
  8. MNP
    MNP avatar
    79 posts
    Registered:
    23 Apr 2008
    02 Mar 2011
    Link to this post
    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
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    08 Mar 2011
    Link to this post
    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
9 posts, 0 answered