Page 1 of 1

generate alpha list of content within menu module?

Posted: Thu May 24, 2007 7:23 am
by robsta
Okay starter for 10... Anyone got any ideas on how to generate an alphabetical list of content from a particular section of the site and then display it in the menu module? Ideally I'd like to specify the alpha breakdown (ie [A - D]) and have the menu create something like this

ie  CLIENTS -> [A - D] -> AjaxCo
                                    Bobux Jones


I can do the sql generation on the [A - D] page to pull the results, I just can't get menu_manager to display it...

Of course I can manually add links, but it seems a bit daft ...

Re: generate alpha list of content within menu module?

Posted: Sat May 26, 2007 4:15 am
by robsta
Okay Elijah has come back with
You should be able to call a UDT from within your menu-manager
template that outputs the needed pages.

See here for an example of how to query the DB from within a UDT:
http://wiki.cmsmadesimple.org/index.php ... ly_updated

Then you can just put:
{your_udt_name} in the correct place in your menu-manager template and
just set up your UDT to output a list of links.

You can also pass params to your UDTS.
{your_udt_name someparam="somevalue"}

Then in your UDT you would access "somevalue" using $params['someparam'].

If needed, you should be able to pass your UDT the id of the current
page like this:
{your_udt_name pageid=$node->id}
and then you can use $params['pageid'] in your UDT.

If you haven't already seen them, you may find the examples here useful:
http://wiki.cmsmadesimple.org/index.php ... nu_Manager
Story long short...

I created a UDT which returned my results in a list.  I then went into the menu_manager and inserted my udt after the tag line ... that way my udt-generated list creates a sub list.

The key to this is to assign an error check on the {your_udt_name pageid=$node->id} to make sure that you only call it if the $node->id is what you require...

Thans Elijah... you've saved me 20 man haours!

R