MenuManager - Custom order and pagination of the menu items

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
sinusiks
New Member
New Member
Posts: 3
Joined: Tue Aug 19, 2008 2:49 pm

MenuManager - Custom order and pagination of the menu items

Post by sinusiks »

Hello,

I am building a website that is displaying some articles that represent some kind of reviews using the latest version of CMSMS. I thought that the best way to do it would be simply by using the standard core content pages since the content has pretty URLs and is easy to manage. I could use Products module or something similar but that just wouldn't be that nice and simple also I can forget about pretty urls and advanced templating... So I created a template that includes:
* {content} - for the main review
* {content block="Rating" oneline="true"}  - to enter editor's rating 1-5 (only numeric)
* {content block="Duration" oneline="true"}  - to enter approx. duration in minutes

Now when I build a menu of these pages using the {menu} tag I get a list of about 30 articles (more to be added soon) that are sorted by date (since new pages are added to the end of the hierarchy) or manually if I change the order of pages in administration.

Now here's what I want to do:
- give user the ability to order the pages in a menu:
  * by title (that is the title of the page)
  * by date of publishing
  * by rating
  * by duration
  (and it would also be nice if I could sort these pages ascending / descending)

- now there are about 30 articles... but what when there will be more than 100 articles.. it would really be nice to make some sort of pagination for this menu - so I could somehow set offset & limit to display only 10 menu items per page and show the user next/previous buttons

Can something like this be done? I don't want to change the code of the MenuManager module since that would mean that it should never be upgraded again .. Since Smarty is very powerful I was wondering if there is a way to do it only in Smarty?
I don't mind building an array of all menu-items, sorting and then displaying them (instead of sql sort) or any other cpu intensive solution since this page will not have much traffic.

And I also don't mind if the solution would be possible using some other type of content (e.g. global content block) .. I just don't want to touch any of the main CMSMS code...

Thanx!
Last edited by sinusiks on Tue Aug 19, 2008 3:17 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: MenuManager - Custom order and pagination of the menu items

Post by Dr.CSS »

You may want to see about using news for this as it has some of the exact things you need, pagination, number of articles limit, extra fields for just text, etc....
Post Reply

Return to “Developers Discussion”