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 ForumsDocumentsDocumentsCustomize Doc Module to hightlight recent Modified DateCustomize Doc Module to hightlight recent Modified Date
Previous
 
Next
New Post
1/6/2009 11:20 AM
 

I have development experience (VS2005/SQL2005/ASP.NET), but I am new to customizing a DNN Module.
I would like to customize the Documents Module to highlight the Modified Date if the modified date is less then 14 days old.

In ASP.NET the code would be something like:

if ModDate > Today.AddDays(-14)  then
   response.write("<b>" & ModDate.toString & "</b>")
else
    response.write(ModDate.toString )
end if

How would I accomplish this customization to the Documents Module in DNN? 

Any point in the right direction would be greatly appreciated.

 
New Post
1/8/2009 12:29 AM
 

Hello,
The documents module is based on the DataGrid component.  In order to accomplish what you're wanting, you'll need the source code to the Documents Module.  You can download it here, www.dotnetnuke.com/Products/Development/Forge/ModuleDocuments/Downloads/tabid/827/Default.aspx.

Basically, you'll need to implement the ItemDataBound event.  Check the control object, and you should be able to dynamically set the appropriate attributes based on your criteria.


-- Scott Allender
http://www.scottallender.com
 
New Post
4/27/2009 4:05 PM
 

You can modify the Stored Procedure named "GetDocuments".  What I'd do is wrap the output in a span with a class identifier.  You can format with CSS.  I did something similar, which I've modified for your situation below:

Just use Sql Server Management Studio, modify the procedure, and replace "Documents.modifiedDate," with the below.  Then create a CSS entry for newDocument and updatedDocument.

    Case When Cast(Convert(varchar(20), Documents.modifieddate, 101) as smalldatetime)=Cast(Convert(varchar(20), Documents.createddate, 101) as smalldatetime) then
   Case When DateAdd(d, -5, GetDate())<Documents.ModifiedDate Then
    '<span class="newDococument">' + Cast(Documents.ModifiedDate As varchar(10)) +  '</span>'
   ELSE
Documents.ModifiedDate
   End
    ELSE
   Case When DateAdd(d, -5, GetDate())<Documents.ModifiedDate Then
    '<span class="updatedDococument">' + Cast(Documents.ModifiedDate As varchar(10)) +  '</span>'
   ELSE
Documents.ModifiedDate
   END
    End As ModifiedDate,

 
New Post
4/30/2009 12:11 PM
 

Jamieson wrote

You can modify the Stored Procedure named "GetDocuments".  What I'd do is wrap the output in a span with a class identifier.  You can format with CSS.  I did something similar, which I've modified for your situation below:

Just use Sql Server Management Studio, modify the procedure, and replace "Documents.modifiedDate," with the below.  Then create a CSS entry for newDocument and updatedDocument.

    Case When Cast(Convert(varchar(20), Documents.modifieddate, 101) as smalldatetime)=Cast(Convert(varchar(20), Documents.createddate, 101) as smalldatetime) then
   Case When DateAdd(d, -5, GetDate())
    '' + Cast(Documents.ModifiedDate As varchar(10)) +  ''
   ELSE
Documents.ModifiedDate
   End
    ELSE
   Case When DateAdd(d, -5, GetDate())
    '' + Cast(Documents.ModifiedDate As varchar(10)) +  ''
   ELSE
Documents.ModifiedDate
   END
    End As ModifiedDate,

I do NOT believe that this would be a valid solution.  The modified date value is a DateTime value, and if something else is returned, an exception will be generated, and the module rendered unusable.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
5/4/2009 4:10 PM
 

Good catch, Mitch is correct, i've tested, and an exception does generate.  I did not realize the front-end required a date.  What I did in my environment is added a new column so I wouldn't affect the existing code, so the original suggestion was the best route.

Sorry for any confusion.

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsDocumentsDocumentsCustomize Doc Module to hightlight recent Modified DateCustomize Doc Module to hightlight recent Modified Date


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