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

Forums / Developing with Sitefinity / Adding CSS classes to links

Adding CSS classes to links

4 posts, 1 answered
  1. Alessio S.
    Alessio S. avatar
    37 posts
    Registered:
    31 May 2010
    27 Dec 2010
    Link to this post
    Hi,
    in the website I'm working on I need to automatically add icons near all links pointing at files uploaded to the Libraries which belong to some predefined types, e.g. PDF icons for *.pdf files. Only client side, they don't need to be shown in the content editors. I think the cleanest way to do this would be to hook into the link rendering and examine the file extension after the library GUID has been resolved. Is this possible? Or there is a better apprach? (I'd prefer to do this server side rather than with JS.)
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    27 Dec 2010
    Link to this post
    Hello Alessio,

    Form the description you provided I suppose that you use DownloadList control, so please check this post

    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
  3. Alessio S.
    Alessio S. avatar
    37 posts
    Registered:
    31 May 2010
    27 Dec 2010
    Link to this post
    Thank you. But actually I need to show the icon near all links to Library files, including those which apprear in generic content or news content outside of a download list.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    28 Dec 2010
    Link to this post
    Hello Alessio,

    In this case you will need some custom control which shows your specific data and parse the content you have, so you can detect whether you have a link in the  content that points to an item and inject the image you want to use.

    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
    Answered
Register for webinar
4 posts, 1 answered