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 ForumsRepositoryRepositoryUse default image as download linkUse default image as download link
Previous
 
Next
New Post
7/11/2007 2:42 PM
 

I'm using the default template and customizing it...  Can I use a default image for each item and turn it into the [DOWNLOAD] link, but NOT use the word download?


Chad Voller -- MCP, DNN Aficionado
Leapwise Media
View my View Chad Voller's profile on LinkedIn
 
New Post
7/11/2007 4:18 PM
 

yes, the [DOWNLOAD] token injects a linkButton control. You can set the text used for the download button in the resource file via the DownloadButton.Text resource key.

So, now here's the magic :)   since the text will just be rendered as text and it supports html tags, you can actually set the text for your download buttons to an img tag, thereby rendering an image for all your download buttons, but still retaining all the functionality of a tooltip, click counting and triggering the download.

there are a couple of things to pay particular attention to..

1. the path to the file needs to be absolute or if it's relative you need to be aware of the current directory
2. in order to enter the html tags in the resource file, I believe you need to wrap the img tag in a CDATA construct

Here's an example:
In the /DesktopModules/Repository/App_LocalResources folder, edit the Repository.ascx.resx file and search for the DownloadButton.Text tag, change it like this...

<data name="DownloadButton.Text">
    <value><![CDATA[<img src='../../../images/download.gif' border='0'>]]></value>
</data>

Now, all of your download buttons will be rendered with the download.gif file (in the above example, of course you can use any image you want).  Notice the relative path, it goes 3 levels back and will look for the image in the ~/images folder.

If you want to make the path absolute, you can do so, you'll have to play with the path to get it right for your particular setup and where you store your image.

 
New Post
7/12/2007 1:58 PM
 

Brilliant! 

Very easy setting to change, and the instructions worked perfectly.  Thank you!

Now, for the NEXT step...  If I wanted to include a new token for images, instead of changing the text of the [download] token to an image, do I have to modify the source, or is there a similarly simply way to do it?

Somehow, I think it's not quite as simple.  No need to explain if it's not simple, b/c I'm not good w/the source modification stuff, but I'm able to work the kind of stuff like above.  Maybe I sell myself short, but "adding a control" or "inserting an object" type of stuff scare me to death.  But I want to learn... Have mercy!!!


Chad Voller -- MCP, DNN Aficionado
Leapwise Media
View my View Chad Voller's profile on LinkedIn
 
New Post
7/13/2007 10:45 AM
 

it's not so easy ..

In addition to adding code to support a new token, you'll have to add a new column to the repository database to store the new image, or if you're okay with a single image for all repository items, then you'll have to modify the module settings code to save/restore a new setting indicating the image to use.

I plan to do a little video blog on how to add a new token very soon ( hopefully sometime this weekend ) which will cover most of the work. The code to support a new module settings is pretty easy as well. So, after I publish the token video, let me know if you're still itchin to make the change and I'll help you out with some sample code for the module settings.

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsRepositoryRepositoryUse default image as download linkUse default image as download link


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