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 ForumsRepositoryRepositoryFeature Request: Order ItemsFeature Request: Order Items
Previous
 
Next
New Post
6/24/2006 3:28 PM
 

ORDERING ITEMS IN REPOSITORY LIST>

The sort feature is great but ordering items is going to be a necessity for most of my advanced templates.

For example. I have created an ITUNES style template for music and I need to keep it in the order of the CD my kids recorded. However the default sort is by date so it has to be entered in just the right order and if edited it updates the date and changes the order. It would be fairly simple to add the orderid but I don't want to mess with the Repository Core if it is something that may be planned.

Any ideas already brewing by anyone else?

 

 


Tom Harris
HowIUseDNN.com
President 9d Interactive
tharris@9di.com

9dtv.com
PracticeNotebooks.com
Frazum.com
BlueDenim.com
 
New Post
6/24/2006 11:30 PM
 
One or more user-defined fields would be handy, even more so if they could drive the sort order.
 
New Post
6/25/2006 3:56 PM
 

Can you give me an example of how you'd set the order? I was thinking along the lines of the Links module where you can set the order using an integer but who do you allow to do that? The user on upload or only the administrator? I'm not shooting the idea down because it's a good one but I'm trying to figure out a good way to do it before I post the request in Gemini.

As a possible work-around for you in the meantime.... What if you titled the items something like CD 1 - N'Sync, CD 2 - Backstreet Boys, etc. and then set the default sort by Title? I'm not 100% sure that would work but I think the CD 1, CD 2, would keep things locked in order no matter when they were updated or what order they were uploaded in.

 
New Post
6/26/2006 3:14 AM
 

A while back I modified the Efficion Article Module based on Announcements to change the order. The Stored Procedures are similar to the Repository module. I added an order control to settings that used an orderID. Only someone with admin rights can re-order it. The order code I wrote is based on code from Michael Washington's ADefServer ASPX Image App. I am dropping the Article Module and switching to the Repository. I have already created two custom templates for 'All' Media. It works with RealMedia, Flash, Windows Media. I also created an ITUNES type of audio interface and that's the one I really need the item ordering on. I have already tried using a naming convention as you suggested but it is a little cumbersome and doesn't match the CD Cover.

I have some screen shots here http://www.9dtv.com/articles_repository.htm

Here is the Stored Procedure. Notice I just set the Sort to ViewOrder. I added a vieworder field to the table.

CREATE PROCEDURE dbo.Articles_GetArticles
   @PortalID   int,
   @ModuleID   int,
   @UserID  int,
   @Categories varchar(100),
   @MaxNumber int,
   @Age   int,
   @ShowAuthOnly bit,
   @Featured bit,
   @IgnorePublishDate bit,
   @IgnoreExpired bit,
   @SortField varchar(100)
AS
DECLARE @ORDER varchar(100)


SET ROWCOUNT @MaxNumber

if @SortField = 'ViewOrder'
 
SELECT ItemID,
       PortalID,
       ModuleId,
       UserID,
       Title,
       Description,
       Article,
       Authed,
       Featured,
       ImageFile,
       NumberOfViews,
       CreatedDate,
       PublishDate,
       ExpireDate,
       LastModifiedDate,
       ViewOrder
FROM Article
WHERE PortalID = @PortalID
AND (@ModuleID = -1 OR (ModuleID = @ModuleID) OR (ModuleID is null))
AND (@UserID = -2 OR ItemID in (
 SELECT DISTINCT ArticleID FROM ArticleRoles
 WHERE (ArticleRoles.RoleID = -1 OR ArticleRoles.RoleID IN (SELECT RoleID FROM UserRoles WHERE UserID = @UserID))
))
AND ( @Categories = '' OR ItemID in (
 SELECT DISTINCT ArticleID FROM ArticleCategories WHERE (ArticleCategories.CategoryID IN (SELECT intValue FROM dbo.csvToInt(@Categories)))
))
AND (@Age = -1 OR (CreatedDate BETWEEN DateAdd(day, @Age, GetDate()) AND GetDate()))
AND (@IgnorePublishDate = 1 OR IsNull(PublishDate, 1) <= CONVERT(CHAR(8), GETDATE(), 112))
AND (@IgnoreExpired = 1 OR IsNull(ExpireDate, DateAdd(d, 1, GetDate())) > CONVERT(CHAR(8), GETDATE(), 112))
AND (@ShowAuthOnly = 0 OR Authed = 1)
AND (@Featured = 0 OR Featured = 1)
ORDER By ViewOrder ASC

else

SELECT ItemID,
       PortalID,
       ModuleId,
       UserID,
       Title,
       Description,
       Article,
       Authed,
       Featured,
       ImageFile,
       NumberOfViews,
       CreatedDate,
       PublishDate,
       ExpireDate,
       LastModifiedDate,
       ViewOrder
FROM Article
WHERE PortalID = @PortalID
AND (@ModuleID = -1 OR (ModuleID = @ModuleID) OR (ModuleID is null))
AND (@UserID = -2 OR ItemID in (
 SELECT DISTINCT ArticleID FROM ArticleRoles
 WHERE (ArticleRoles.RoleID = -1 OR ArticleRoles.RoleID IN (SELECT RoleID FROM UserRoles WHERE UserID = @UserID))
))
AND ( @Categories = '' OR ItemID in (
 SELECT DISTINCT ArticleID FROM ArticleCategories WHERE (ArticleCategories.CategoryID IN (SELECT intValue FROM dbo.csvToInt(@Categories)))
))
AND (@Age = -1 OR (CreatedDate BETWEEN DateAdd(day, @Age, GetDate()) AND GetDate()))
AND (@IgnorePublishDate = 1 OR IsNull(PublishDate, 1) <= CONVERT(CHAR(8), GETDATE(), 112))
AND (@IgnoreExpired = 1 OR IsNull(ExpireDate, DateAdd(d, 1, GetDate())) > CONVERT(CHAR(8), GETDATE(), 112))
AND (@ShowAuthOnly = 0 OR Authed = 1)
AND (@Featured = 0 OR Featured = 1)
ORDER By
 CASE @SortField
  WHEN 'PublishDate' THEN PublishDate
  WHEN 'LastModifiedDate' THEN LastModifiedDate
  WHEN 'CreatedDate' THEN CreatedDate
  ELSE LastModifiedDate
     END DESC,
 LastModifiedDate DESC

GO


Tom Harris
HowIUseDNN.com
President 9d Interactive
tharris@9di.com

9dtv.com
PracticeNotebooks.com
Frazum.com
BlueDenim.com
 
New Post
6/26/2006 1:11 PM
 
Thanks for your explaination. I've added it to Gemini but unfortunately I can't give you a timeline on when it would be implemented.
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsRepositoryRepositoryFeature Request: Order ItemsFeature Request: Order Items


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