Welcome to Geeklog, Anonymous Wednesday, December 11 2024 @ 04:39 am EST

Geeklog Forums

Howto replace menu elements on a plugin page


Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
Hi everybody,

I would like to have one menu on home page and another complety different menu on my-new-plugin page.

How can I build this?

All ideas and tools are welcome. Thanks,

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: Banned

gtgillis

Forum User
Full Member
Registered: 11/05/03
Posts: 121
Quote by: cordiste

Hi everybody,

I would like to have one menu on home page and another complety different menu on my-new-plugin page.

How can I build this?

All ideas and tools are welcome. Thanks,

::Ben



Do you mean the additional menu like the Forum adds to the top left here at geeklog.net or a complete substitution?
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
Yes I try to make a complete substitution Confused:

Thanks,

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1470
Location:Canada
So essentially you want your plugin to display it's own set of left or right blocks sort of like a topic?
One of the Geeklog Core Developers.
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
What I would like to make is a complete substitution of the menu elements.

On my front page my menu could be :

* Contribute
* Downloads
* My cool plugin
* Links
* Polls
* Directory

And I would like on my cool plugin page :

* Trees
* Flowers
* Tools
* Fields

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

suprsidr

Forum User
Full Member
Registered: 12/29/04
Posts: 555
Location:Champaign, Illinois
use jquery for content substitution:
Text Formatted Code

var myMenuHTML = '<ul class="my-new-menu"><li> Trees</li><li>Flowers</li><li>Tools</li><li>Fields</li></ul>';
$('#my_normal_menu_element').html(myMenuHTML);
 


or prepend
Text Formatted Code

var myMenuHTML = '<ul class="my-new-menu"><li> Trees</li><li>Flowers</li><li>Tools</li><li>Fields</li></ul>';
$('#my_normal_menu_element').prepend(myMenuHTML);
 

or append
Text Formatted Code

var myMenuHTML = '<ul class="my-new-menu"><li> Trees</li><li>Flowers</li><li>Tools</li><li>Fields</li></ul>';
$('#my_normal_menu_element').append(myMenuHTML);
 


-s
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
 Quote

Status: offline

Roccivic

Forum User
Moderator
Registered: 05/19/10
Posts: 136
Not sure if this will be useful to you, but the alternative to a JS solution is to hack into core. You can insert the below code into lib-common.php (at line 592 in geeklog 1.7.2).

Text Formatted Code
if (true) {
    $_CONF['menu_elements'] = array('plugins');
    $plugin_menu = array('birds' => $_CONF['site_url'] . '/birds/index.html',
                         'bees'  => $_CONF['site_url'] . '/bees/index.html');
}


Of course, you will need to replace the "always true" condition with something that will tell you whether you are on your cool plugin's page or not.

Rouslan
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
Thank you for the two ways. I like both.

@ Rouslan : As I don't want to hack the core, I could tell to my plugin to display the normal menu when user is not on the "very cool plugin" page and display the second one when user is on the plugin pages.

I also see another way, I could create the first menu in a staticpage on frontpage, and use a second menu on plugin page.

Thanks,

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
create the first menu in a staticpage on frontpage


As it is a project for june 2011, I have start the mock-up with a menu in staticpage.
For those interested, you can see a preview here.

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1470
Location:Canada
One of the next features I plan to work on for Geeklog 1.8.1 is the ability to assign a plugin item a topic. This means when this item is displayed it will take on the characteristics of the topic including the blocks. This also means you will have some more control over the menu items as I plan to update the staticpage plugin to support this (ie a staticpage belonging to the News Topic would only display it's menu item if the visitor was on a page assigned to the same topic).
One of the Geeklog Core Developers.
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
the ability to assign a plugin item a topic


Very good news if a plugin can have more control on the menu and block elements. :shakehands:

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
Have you considered reading the forum code and learning how to do using the existing codebase? There are features to the sideblocks that I think only the forum makes use of. But that doesn't mean other plugin can't use it. It's just not well documented.
 Quote

All times are EST. The time is now 04:39 am.

  • 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