Welcome to Geeklog, Anonymous Saturday, December 21 2024 @ 12:02 pm EST
Geeklog Forums
plg_menu_elements in a block?
vbgunz
How do I get {plg_menu_elements} to show up in a block? Better yet is it possible when any new elements are added they automatically break and create a new line for the link?
Instead of a menu that might look like this...
------
advanced
search
contact FAQs forum
My Downloads
------
Get it to show in
a block like this...
------
advanced
search
contact
faqs
forum
my downloads
------
I am trying real hard to solve it but I am spoofed... I did the search for plg_menu_elements and it pulled back some results.. Sorry to say none was too helpful except for one which somewhat got me lost...
I read something about check in lib-common and edit into lib-custom but I guess thats where I got lost... Can someone shine some light on the subject? Thanks
Victor B. Gonzalez -
http://aeonserv.com
Dirk
That variable is only supported in header.thtml. If you want to use it in a block, you will have to copy the code that creates it from function COM_siteHeader() in lib-common.php. To use it in a block, you will have to create a PHP block and use that code in the phpblock_... function for that block.
Since all you seem to want to have is a list of the plugin menu items in a block, something like this is all you would need (while the above would require the use of templates) (untested!):
{
$retval = '';
$plugin_menu = PLG_getMenuItems();
for( $i = 1; $i <= count($plugin_menu); $i++ )
{
$url = current($plugin_menu);
$plg = key($plugin_menu);
$retval .= '<a href="' . $url . '">' . $plg . '</a><br>';
next( $plugin_menu );
}
return $retval;
}
Put that function in your lib-custom.php, create a new block of type PHP block, enter phpblock_plugin_menu as the name of the function and try it out ...
bye, Dirk
Anonymous
MaXi-XCeL
Dirk
In /path/to/geeklog/system/lib-plugins.php, in function
PLG_getMenuItems
, insertksort($menu);
just before the
return $menu;
bye, Dirk
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content