Download List
Hi,
How do I go about getting the download list to display the document title...rather than the document file name?
Is this possible out of the box or do I need to create a custom widget?
Any help, as always is appreciated.
Cheers,
Hello James,
We set the document file name as a document title during upload. You can edit the item after it has been uploaded and modify its title.
In our code we get the Document Title and display it by MasterListView of the control
var document = (Document)dataItem;
documentLink.Text = document.Title;
documentLink.ToolTip = document.Description;
documentLink.NavigateUrl = document.MediaUrl;
Thanks again Ivan!
I figured that this is what should have happened but due to an upload error it did not. I noticed that uploading a set of large files caused IE to crash, this locked the files in all kinds of weird ways which caused this issue. (I have a video of this happening if you want it.
While I am on the matter...How do I go about changing the appearance of the download List on SF4?
Thanks in advance,
Hello James,
We received some other requests about issues with IE, but we did not mange to replicate any issues, so if you can share the video with us we will follow your steps and try to figure out what the problem is.
Changing appearance of DownloadList - you can add css classes to your theme stylesheet that will change the appearance of the control, you can use some of the built-in options in the ControlDesigner of the control and you can map the template to the control by using LayoutTemplatePath property
Below is the control template.
<%@ Register TagPrefix="sitefinity" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
<
div
id
=
"itemsContainer"
runat
=
"server"
>
<
asp:Repeater
ID
=
"documentsRepeater"
runat
=
"server"
>
<
HeaderTemplate
>
<
ul
class
=
"sfdownloadList sfListMode"
>
</
HeaderTemplate
>
<
ItemTemplate
>
<
li
id
=
"docItem"
runat
=
"server"
class
=
"sfdownloadFile"
>
<
sitefinity:SitefinityHyperLink
ID
=
"documentLink"
runat
=
"server"
CssClass
=
"sfdownloadTitle"
target
=
"_blank"
/>
<
sitefinity:SitefinityLabel
id
=
"infoLabel"
runat
=
"server"
WrapperTagName
=
"div"
HideIfNoText
=
"false"
CssClass
=
"sfInfo"
/>
</
li
>
</
ItemTemplate
>
<
FooterTemplate
>
</
ul
>
</
FooterTemplate
>
</
asp:Repeater
>
</
div
>
<
sitefinity:Pager
id
=
"pager"
runat
=
"server"
NavigationMode
=
"Links"
></
sitefinity:Pager
>
Hi,
Is it possible to make the list pick only specific categories?
Thanks
Madhavan
Madhavan,
I may be over simplifying what you want here...but you should just be able to do select categories on the widget.
See attached picture.
Hi Ivan,
I'm trying to do something but can't seem to find an answer. I saw this thread from an earlier version, and believe the problem is the same. I have the documentlist widget added to a page. I have a document library (Press Releases) whose documents I am displaying in the control. I added a custom field called "Header", as the library fields were insufficient for my needs.
I want to display the documentlist, but don't want to use the file name as the link back to the document (I don't want to see it at all). I made a change to the documentlist template to hide the file name field:
<sitefinity:SitefinityHyperLink ID="documentLink" runat="server" Visible="false" CssClass="sfdownloadTitle" target="_blank" />
I then added the field that I want to include in the document list below:
<sitefinity:TextField runat="server" DisplayMode="Read" Value='<%# Eval("Heading")%>' />
But, I don't know how to make the "Heading" field the file link, instead of the filename. Any ideas how to change this in version 4?
Mark
Hi Mark,
You can not modify SitefinityHyperLink because the ID it uses get the Title and the URL to the document. You can use
<
asp:HyperLink
ID
=
"HyperLink1"
runat
=
"server"
navigateUrl
=
"http://localhost:60876/docs/press-release/document.docx?Status=Master"
> <
sitefinity:TextField
runat
=
"server"
DisplayMode
=
"Read"
Value='<%# Eval("NEWField")%>' /></
asp:HyperLink
>
Stanislov,
So the only way to use probably the most important widget in the CMS is to display the links by file? I will have to rename every file in my document libraries to display them, or will have to use something like the content widget and hardcode links back to documents in the library (and not be able to take advantage of using filtering and sorting). Is that correct?
Mark
Hi Kim,
If you configure the widget to works in List + Detail page or Table + Detail page you will see a download link
<sf:SitefinityHyperLink ID="documentLinkBottom" runat="server" CssClass="sfdownloadLink" target="_blank" />
which shows the link by a file.
Generally we set the document.Media url property of the hyperlinks, so this could be done easily in a custom or a user control.
All the best,
Ivan Dimitrov
the Telerik team