Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Menu Generator #132

Open
upsonp opened this issue May 26, 2014 · 18 comments
Open

PHP Menu Generator #132

upsonp opened this issue May 26, 2014 · 18 comments

Comments

@upsonp
Copy link
Member

upsonp commented May 26, 2014

@crochefort I've done some preliminary work on a mega menu, left menu and landing page generator we spoke about last week. It's still pretty specific to my site, but I think I'll be able to pull the code out.

The Mega menu isn't working, I don't know why yet, but I think that's due to the fact I'm using a version of WET 4.0 from an IM&TS development server, and hasn't been implemented properly or updated. I'll get a copy of WET 4.0 on my local machine tomorrow for better testing.

Start on the BIO Home page
step1

Click on Science (or Data and Products)
step2
step3

Notice a landing page is created from the top-level left side options. The left side shows the current level and one level below. The Breadcrumb can be used to go up a level.

@crochefort
Copy link
Contributor

I'm pretty sure it a good start and will resolve the issue we have with the left menu 👍

@upsonp
Copy link
Member Author

upsonp commented May 27, 2014

I'm running the WET 4.0 Core from my local machine now and it seems to have fixed the issue with the arrows in the breadcrumb trail not being rendered properly, but the Mega Menu is completely broken. I've tried auto-generating it, hard coding it, and using Ajax replacement, but it'll only display the top level elements with no popup menus.

@crochefort
Copy link
Contributor

@upsonp you have your answer right here! wet-boew/wet-boew#5307 (comment)

@upsonp
Copy link
Member Author

upsonp commented May 27, 2014

Thanks @crochefort,
For some reason I think I've read that previously... So limited left side and no site menus, getting easier to hide stuff in GoC pages everyday.

@crochefort
Copy link
Contributor

lol ... what they want is ... reducing the amount of page canada.ca will have! ... How to post your stuff... think twice before posting it!

@upsonp
Copy link
Member Author

upsonp commented May 28, 2014

I figured out why the mega menu wasn't working. Apparently under the "News" menu in the page footer I had:

<!--<ul></ul>-->

The mega menu doesn't work unless all footer menus have at least one entry under them. Originally on the BIO site I had the heading "News" linked to the BIO publications page. Since headings aren't linked anymore, I just added a link under news and the mega menu started working... kind of... again

It still isn't printing all of the elements it should, because I haven't implemented it yet, but the mouse over popup is working.

@upsonp
Copy link
Member Author

upsonp commented Jun 3, 2014

@crochefort finally got the mega menu working in a decent way. Check it out

megamenu

It will expand out to as many levels as needed, but we should probably put a limit on it so we won't end up with six nested menus.

Downside, multiple nested menus don't display at all in mobile view. So landing pages are required.
megamenu_mobile

Now if I can get the left side to generate as nicely we'll be good to go

@crochefort
Copy link
Contributor

👍 good job! For my self, i'm just waiting to get the wording from the meeting my manger attends!

Will be using that to reorganize my menu/navigation. So I'm just waiting to get more info to have an idea of where I should go!

@upsonp
Copy link
Member Author

upsonp commented Jun 3, 2014

Did the same thing with the Left Side I did with the Mega Menu with some modification. Same issue as noted above with the mobile menu not displaying nested menus under Science. I'll have to keep looking at it, but it'd be nice to at least get it to show (Data and Products, Monitoring, Research and New Technologies) under the Science menu instead of just "Science - More"

Does make for a very long page.

leftmenu

@upsonp
Copy link
Member Author

upsonp commented Jun 3, 2014

Fixed the nested menu issue for the mobile menu for both the Left side and Mega menu. I was missing a <li> around the <details> elements
leftmenu

@crochefort
Copy link
Contributor

Good job .. let me know how the code is working and I'll be able to take a look!

@upsonp
Copy link
Member Author

upsonp commented Jun 4, 2014

I've started some documentation for the menu utility here https://github.com/wet-boew/wet-boew-php/wiki/Menu-Utility

I need to figure out how the utility will be distributed. It can be separated completely from the PHP Variant, but I don't necessary think it should be it's own project.

@crochefort
Copy link
Contributor

Quick question about the distribution...
Can you create a V4-Menu and each time you made some changes in the V4 it will automatically update the V4-Menu ... So you keep you config in V4-menu and for people who want to only have the normal one download the V4.

@upsonp
Copy link
Member Author

upsonp commented Jun 5, 2014

If I understand correctly, I don't think that will be necessary. Using the Menu utility doesn't affect your PHP variant install at all. I still have to get through a ton of documentation in the wiki to explain the process, but all the setup to use the menu utility is done with your individual configuration and doesn't rely on the PHP Variant configuration at all. The only file that would ever change if the menu utility was updated would be the menu-util.php file. I think the wiki documentation might be confusing because it makes it seem like there are four files I'm providing to make the utility work, but really the left-menu-gauche.php, menu constants, and prim-megamenu.php are all provided by the user and depend on the user to configure them.

Here's an examples from the Bedford Institute site

index-en.php
This is where the path to the left side menu is set the PHP variant uses the $_PAGE['left_menu_gauche'] variable.

<?php 
    $_PAGE['lang1'] = "en";
    $_PAGE['title_'.$_PAGE['lang1'] ] = "Bedford Institute of Oceanography";
    $_PAGE['issued'] = "2011-08-02"; 

    include_once $_SERVER["DOCUMENT_ROOT"]."/sites/bio/templates/path-config.php";
    //this is the only time the user needs to hard code the path, once the
    //configuration file has been required all other paths can use the variables from that
    //file. 
    require_once $_SITE['DOCUMENT_ROOT'] . "/templates/config.php";

    /* These are the required variables fore each page */
    //set 'lang1' to 'en' for English pages, 'fr' for French pages

    require_once $_SITE['DOCUMENT_ROOT']."/includes/applications/util.php";

    //Left side menu included here
    $_PAGE['left_menu_gauche'] = $_SITE['DOCUMENT_ROOT']."/includes/menus/left-menu-gauche.php";
...

left-menu-gauche.php
The PHP variant includes the left-menu-gauche.php file in the foot-nav.php file. Then I include BIO menu constants file, it contains the variable $bio_menu. Then I include the menu-util.php file and print the results of the buildLeftMenu method.

<?php
    require_once($_SITE['DOCUMENT_ROOT'] ."/includes/menus/menu_constants_bio.php");
    require_once($_SITE['DOCUMENT_ROOT'] ."/includes/menus/menu-util.php");

    echo buildLeftMenu($bio_menu);
?>

@crochefort
Copy link
Contributor

AHhhhhhhhhhhhhhhhhh much clearer now!

@upsonp
Copy link
Member Author

upsonp commented Sep 12, 2014

@crochefort

I was contacted by someone interested in the Menu-utility I've been working on and it prompted me to make the updates to get it working. I've added the /dist-php/menu/menu-util.php, /dist-php/menu/menu-util.css and demos to the /demos-php/theme-gcwu-fegc/ folder for the menu-utility.

I don't know if it would be difficult for you to test, but if you could have a look that would be great?

@crochefort
Copy link
Contributor

Cans you send me your file on my corporate account? Last time I think you reply to github with the file...

Thanks!

I think i'm at that point now with the website. (almost everything is done and working)

@upsonp
Copy link
Member Author

upsonp commented Oct 3, 2014

Sorry I'm actually at home today.

I don't have the files. I'll try to remember to send one on Monday, but if
you don't hear from me feel free to poke me.

I might be able to access my FTP server if I can find the connection
details, I'll look into it.

On Fri, Oct 3, 2014 at 9:34 AM, crochefort [email protected] wrote:

Cans you send me your file on my corporate account? Last time I think you
reply to github with the file...

Thanks!

I think i'm at that point now with the website. (almost everything is done
and working)


Reply to this email directly or view it on GitHub
#132 (comment)
.

Regards,
Patrick Upson

Twitter: @PatrickUpson

CIPS NS - Membership Director

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants