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

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Is there a Page/Tab ordering module?Is there a Page/Tab ordering module?
Previous
 
Next
New Post
3/15/2006 1:06 PM
 

kro77 wrote
I am guessing this is not a problem with many

It's a problem for me!  We use separate pages to track projects and other pieces of work, I'm constantly having to re-order the pages.  I'd love a drag and drop interface or more preferably an auto-sort option.

 
New Post
3/15/2006 2:04 PM
 
Hmmm... what about altering the stored procedure(s) used to build the menu so that it's sorted however you want it?  I'm not familiar enough with DNN's inner workings to know what sproc(s) would be involved or if this is even feasible.

Bryan Johns
K4GDW

"There are 10 types of people. Those who understand binary and those who do not."
 
New Post
3/16/2006 6:24 AM
 

Or maybe a trigger on the Tabs table that renumbers the TabOrder column.  The only problem is that I only want to sort some menus alphabetically. 

 

 

 
New Post
3/16/2006 1:28 PM
 

I've created a stored procedure to update the TabOrder of the children of a particular Parent:

CREATE PROCEDURE dbo.SortTabs(@ParentID int) AS

--Stop return of row count
SET NOCOUNT ON

DECLARE @Seed int -- Holds lowest TabOrder of child tabs
DECLARE @TempTabs TABLE (TabID int, TabName nvarchar(50), Auto int IDENTITY(0,2), TabOrder int) -- Auto column will be numbered 1,3,5,7,etc.

-- Get current lowest tab ID
SET @Seed = (SELECT TOP 1 TabOrder
    FROM Tabs
    WHERE ParentID = @ParentID AND IsDeleted = 0
    ORDER BY TabOrder ASC)

-- Select child tab details into table variable in alphabetical order
INSERT INTO @TempTabs(TabID, TabName)
 SELECT TabID, TabName
 FROM Tabs WHERE ParentID = @ParentID
 ORDER BY TabName ASC

-- update child TabOrder
UPDATE @TempTabs
 SET TabOrder = @Seed + Auto

-- update Tabs table with new TabOrders
UPDATE T
 SET T.TabOrder = N.TabOrder
  FROM Tabs T JOIN @TempTabs N ON T.TabID = N.TabID
GO

I don't claim this is the best SQL in the world, I'm sure someone can do better.

You can run the procedue by passing the ParentID e.g.:

EXEC SortTabs 168

You can see the effect by running this code before and after the procedure:

SELECT * FROM Tabs WHERE ParentID = 168 ORDER BY TabOrder ASC

This appears to work fine, but you still have to go into the GUI and move at least one page manually for the changes to take effect.

Thanks to these guys: http://www.janetsystems.co.uk/Default.aspx?tabid=71&itemid=184 & http://dnn.bi4ce.com/Forums/tabid/242/forumid/2/postid/52/view/topic/Default.aspx

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Is there a Page/Tab ordering module?Is there a Page/Tab ordering module?


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