Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsRepositoryRepositoryAttributes used to create custom iconsAttributes used to create custom icons
Previous
 
Next
New Post
9/24/2008 4:40 AM
 

I have an attribute I would like to use to reference a custom icon for each item in the repository but can't seem to work out how to do it?

I have an attribute called File Type with pdf,doc,ppt etc as options as was hoping to use this to reference <img source="/portals/0/images/[Attribute:File Type].gif/>

Any help would be greatly appreciated!

 
New Post
9/24/2008 10:14 AM
 

There is already support for returning an icon image based on the file extension of the file uploaded to the repository. So for each repository item, you can display a custom icon.

In your template.html file, add a token named [FILEICON] where you would like the icon displayed.

In your template.xml file, add an object tag for the token and set the desired Height, Width and whether or not you want clicking on the icon to trigger the download function. PLEASE NOTE: All tags, settings and values are case-sensitive

 <Object>
  <Token>[FILEICON]</Token>
  <Settings>
   <Setting>
    <Name>Width</Name>
    <Value>24</Value>
   </Setting>
   <Setting>
    <Name>Height</Name>
    <Value>24</Value>
   </Setting>
   <Setting>
    <Name>DOWNLOAD</Name>
    <Value>false</Value>
   </Setting>
  </Settings>
 </Object>

Then finally, in the /DesktopModules/Repository/images/icons folder, place your icon files for each file type. The repository will look for an image file with the extension in the following order, gif, png then jpg. So, for example, if the file has an XLS extension it will look in the icons folder for xls.gif. If it does not find it, it will look for xls.png. If still not found, it will look for xls.jpg. Finally if it hasn't found an image for the extension, it will use unknown.png as the image.

 
New Post
10/1/2008 10:20 AM
 

Thanks Steve, that worked perfectly!!

However I actually also wanted to be able to use an attribute to reference a specific file as a link as well.  I am doing a repository containing Station Information for about 70 stations, each of which occurs on one of 8 network maps.  I wanted to use an atribute to store the Network Map Number and then use that value to provide a link to the relevant station access map for each station.

I hope that is clear enough...is it possible??

 
New Post
10/1/2008 12:25 PM
 

Hi Oren,

You can achieve that using something like this in your template.html file:

<A href="[FILEURL]/?mapnumber=[#ATTRIBUTE:MapNumber]">[#TITLE]</A>

The trick is to use the # in with the token so that the repository module only renders the raw data without any tags or formatting.

This was a feature that was added in the 3.01.14 release.

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsRepositoryRepositoryAttributes used to create custom iconsAttributes used to create custom icons


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out