Need to change order of pages in the Pages menu

Topics: Business Logic Layer, Controls
Dec 11, 2008 at 12:46 PM
Hi,

I am using Blog Engine as a CMS rather than a blog and am using the excellent Menu User Control to build my sites menu from the sites pages (not blog posts).

How can I change the order of these pages in the menu? They seem to be listed by date added.

thanks,

Nick

Dec 11, 2008 at 1:35 PM
Unless you want to start extending some core code for that Control, you need to take a different approach. (But a good idea for an extension of this control)
  1. Add a Text Box control, rename it to "Pages" (or appropriate description).
  2. Promote the Text Box to top of right margin.
  3. Populate this with your Pages in the correct order; copy-paste the URL links from the Pages control into the HTML page content for the text box.
  4. Remove your Pages control by clicking its X delete control.
  5. Temporarily Re-Add your Pages control when you want the correct URL for a page added.
Like me, (here) you're using BE as a framework for a web-site using pages for content, with some blogging thrown-in.

(another) Nick
Dec 24, 2008 at 8:14 AM
Does this mean I would have to extend the page class to add an 'OrderByID' property and somehow retrieve the files in order of this ID?

I have multiple levels in my menu, e.g. nested UL tags. I want to be able to change the order for each level in the menu.
Coordinator
Dec 24, 2008 at 8:03 PM
I think Nick is suggesting that you replace the Pages widget for the Textbox widget, as a workaround.  The Textbox widget allows you to put any content in a "textbox".  The textbox widget uses the WYSIWYG editor, so you can use any HTML formatting you'd like (UL tags, etc).  With this approach, you would manually insert the hyperlinks to your pages using the Textbox widget WYSIWYG editor.

Using the Textbox widget in place of the Pages widget would not involve any extending of the Page class, etc.  At the most, you might need to add or edit some styles to your CSS file to control the look of the textbox.
Dec 25, 2008 at 11:02 AM
BenAmada - Correct. The Pages Control doesn't allow us to re-order the list of pages. Using a Text Box control I can include Pages and other resources as a side-menu. I still use the Pages Control - but only to grab the Page URL - and then delete the control when I've done with the editing of the text box HTML and links. I don't need any CSS changes to the Text Box, as I'm using a simple bulleted list. Of course you could indent your sub-items to make it more context appropriate.

Nick
Coordinator
Dec 25, 2008 at 4:15 PM
I'd imagine using the Pages widget to get the URL of a page may not even be necessary.  If you know the slug of the page, the URL will be page/slug.aspx.  Also after saving changes to a page, you're navigated to the page where the URL is exposed in the browser address bar.
Feb 22, 2009 at 8:08 PM
View this thread for info about a patch