Topic Closed

Hello,

i am trying a pulldown menu which has on one hand the menu entries of the pages / subpages and on the otherhand the categories of the simple-blog for example I try to create a list like:

  • Home
  • About me
  • Projects
    --> Project 1
    --> Project 2
  • Contact
  • Blog
    --> Category 1
    --> Category 2

I alround found a way to get a array of all categories, but I didn't found a way to get an array of the page-tree is there a way to get this as raw data? I don't really like to modify the existings function because I am thinking that all this modifiction will be gone after the next update.
Maybe some here has a idea for my menu idea? I would be very glad when I get some help.
best regards
Dan

 

9 years ago#7041

jogai
264 Posts

A pulldown for the menu is surely possible. Here is a pure css implementation: wingstovictory.nl

For the blog its a bit trickier because there are too many things in the widget. Is there a way to output a part of the widget instead of everything?

9 years ago#7043

I thing my biggest problem is that I have to merge the normal menu and the category list, because the

gpOutput::Get('Menu')

geht's me with every posible Parameter a complete <ul>...</ul> structere and I have no chance to add a addition li Element for my category list

9 years ago#7045

jogai
264 Posts

Thats true. It would be nice if we could use the individual blog gadget items in our themes.

However, you can still style the whole thing the same and set it next to eachother so it looks like one menu.

9 years ago#7048

fly06
263 Posts
20.9K Downloads
1 Themes
8 Plugins

I thing my biggest problem is that I have to merge the normal menu and the category list, because the gpOutput::Get('Menu')

You can extends the gpOutput static class in your theme.

Create a gpOutputCustom.php file at the root of your theme folder:

<?php

global $gpOutConf;

$gpOutConf['TopTwoMenu']['method']        = array('gpOutputCustom','GetTopTwoMenu');

class gpOutputCustom extends gpOutput {

    static function GetTopTwoMenu($arg=''){
        $source_menu_array = gpOutput::GetMenuArray($arg);

        $sendMenu = array();

        foreach($source_menu_array as $key => $titleInfo){
            if( $titleInfo['level'] >= 2 ){
                continue;
            }
            $sendMenu[$key] = true;
        }
        gpOutputCustom::OutputMenu($sendMenu,0,$source_menu_array);
    }

    static function OutputMenu($menu,$start_level,$source_menu=false){

    // YOUR CUSTOM CODE GOES HERE

    }

}

And use your custom method in your template.php file:

<?php

global $page;

include($page->theme_dir . '/gpOutputCustom.php');

?>

<!DOCTYPE html> 

...

                    <div id="nav">
                        <?php
                            $GP_ARRANGE = false;
                            gpOutputCustom::Get('TopTwoMenu');
                        ?>
                    </div>

...

</html>

And you are done.

 

9 years ago#7049

First I would like to say thank you for the help it and exuse me that I take so long for my answer. This looks like exactly what I am looking for and a little more :-) But I have a addition question is there somewhere I documention which data structures hold the menu entries? Because the $menu variable looks only like a array of bolans, and before I start to understand the orginal gpOutput maybe there is a little documentation?

9 years ago#7055

fly06
263 Posts
20.9K Downloads
1 Themes
8 Plugins

Hi Dan,

$gp_menu contains the mapping: page index => page hierarchy level.

$gp_index contains the mapping: page Slug/Url => page index.

See the /data/_site/pages.php file for details.

 

 

9 years ago#7060

Topic Closed

 

News

elFinder 2.1.50 in Upcoming Release
12/28/2019

A new release for Typesetter is in the works with a lot of improvements including the ... Read More

Typesetter 5.1
8/12/2017

Typesetter 5.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

More News

Log In

  Register