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 ForumsRepositoryRepositoryRemoving mandatory File upload and modifying Repository dashboard.Removing mandatory File upload and modifying Repository dashboard.
Previous
 
Next
New Post
5/15/2007 7:28 AM
 

To add an item description to the Repository, you need to add a new TOKEN to the Dashboard templating code. It's really not too difficult.

First, we need to add a handler for the new token we're going to create. In the RepositoryDashboard.ascx.vb file, look for the Case statement in the lstObjects_ItemDataBound() function. You'll see a case statement where it determines which Dashboard mode you are using ( ie: index, top10downloads, top10rated, etc ) which you've set in the Dashboard modules settings page.

So, for this example, let's say you want to add a description token to the top10downloads mode of the template you're using ( the changes would be the same for whichever mode you want to add this token to, or you could just add the token to all modes ).  Within the "Case "top10Downloads"" you'll see another Case statement which handles the tokens, FILENAME, COUNT, IMAGE, etc.  Add a new case statement for DESCRIPTION as follows

Case "DESCRIPTION"
  Dim objLabel As New Label
  Dim sDesciption as String = ""
  Dim iWidth As Integer = CInt(oRepositoryBusinessController.GetSkinAttribute(xmlDoc, "DESCRIPTION", "Width", "-1"))
  If iWidth <> -1 Then
    sDesciption = HtmlUtils.Shorten(objItem.Description, iWidth, "...")
  Else
    sDesciption = Server.HtmlDecode(objItem.Description)
  End If
  objLabel.Text = sDesciption
  objLabel.CssClass = oRepositoryBusinessController.GetSkinAttribute(xmlDoc, "DESCRIPTION", "CssClass", "normal")
  objPlaceHolder.Controls.Add(objLabel)

There are 2 settings in the .xml file associated with your template that will allow you to have some control over the format and display of the description. a "Width" setting that you can use to display some number of characters of the Description, and the "CssClass" setting to control the style applied to the token.

 <Object>
  <Token>[DESCRIPTION]</Token>
  <Settings>
   <Setting>
    <Name>CssClass</Name>
    <Value>normal</Value>
   </Setting>
   <Setting>
    <Name>Width</Name>
    <Value>20</Value>
   </Setting>
  </Settings>
 </Object>

So, in the example above, I'm setting the class to "normal" and indicating that I only want to display 20 characters. If the Width setting was missing, or set to -1, then it would display the entire description.

And then, finally, you would then be able to use your new [DESCRIPTION] token in your dashboard template. So again, in this example I would edit "dashboard.downloads.html" and add the token where I wanted it to appear.

<TABLE CLASS="normal" WIDTH="100%" CELLSPACING="0" CELLPADDING="0" BORDERWIDTH="0">
  <TR WIDTH="100%" style="padding-bottom: 3px;">
    <TD CLASS="SubHead" ALIGN="Left" WIDTH="75%" VALIGN="Top">[FILENAME]<br>[DESCRIPTION]</TD>
    <TD CLASS="SubHead" ALIGN="Right" WIDTH="25%" VALIGN="Top">[COUNT]</TD>
  </TR>
</TABLE>

That should do it :)  Let me know if you have any problems/questions.

 
New Post
5/15/2007 6:01 PM
 

Steve mate thank you very much for your help This is exactly what I want. I spent a good part of yesterday battling this out and my efforts proved futile.

I just wanted to add for the benefit of those who are a little new to development and DNN (like my self)  when making the changes to the dashboard of the repository module, you need to include the following namespace at the top of the RepositoryDashboard.ascx.vb:

Imports DotNetNuke.Common.Utilities

without adding this namespace you will get an error saying that HtmlUtils has not been declared.

Thank you very much for your help once again.

Best Regards

Johann

 
New Post
5/16/2007 6:18 PM
 

G'day Paul,

I sure did get my requirment sorted out thanks to Steve Fabian.

I have uploaded the module to my uat test site. (http://uatccs.webstream.co.nz) You can see the dashboard repository on the landing page in the right panel at the bottom entitled Latest News - Test. (When clicking on the Title you will be directed to the article).

If you like it and would like the module, let me know and I'll send you the dll's and the source files for you to implement in your web app. (If you require some others mods let me know and if time permits I can help you out).

Cheers

Johann

 
New Post
5/27/2007 8:03 AM
 

Dear Steave

Your solution regarding (turn the validator on/off using the form.xml settings file.) as following

I am using DNN 4.5.1

I reviewed the Form.ascx.vb and it is exactly as you wrote it.

So I went to the form.xml related to my template (default) and i added the file token as you wrote it and save.

Nothing happen in the application, am still receiving validator warning to upload a file!!

Can you explain how to solve this issue Please?

Thanks

 

 
New Post
5/28/2007 2:57 AM
 

Why not using the News Article module from Ventrian ?? It seems that it does exactly what you want.

Déclic Vidéo FX

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsRepositoryRepositoryRemoving mandatory File upload and modifying Repository dashboard.Removing mandatory File upload and modifying Repository dashboard.


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