Dealing with different Foundation navigation systems and having the theme implement navigation in an easy and straight forward way has been an issue. Examples of this can be found at #1825876: How to use Foundation Navigation?, #1934076: Support top-bar rather than nav-bar , #2018739: Top bar broken in STARTER template.php. Alexweber had a cool simple theme setting to handle this but at the same time we want to avoid adding too much complexity.

Suggestions or feedback welcome otherwise my vote goes to adding a simple theme configuration.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexweber’s picture

Assigned: Unassigned » alexweber
alexweber’s picture

Status: Active » Needs review
FileSize
7.9 KB

This one is a pretty simple change but big in that it affects a few different files so please review it and let me know if it's good to commit!

Thanks

chrisjlee’s picture

+++ b/STARTER/templates/page.tpl.phpundefined
+<!-- Top bar -->
+<?php if ($zurb_foundation_top_bar): ?>
+  <div class="<?php if ($zurb_foundation_animate) { print 'animated '; print $zurb_foundation_animate; } ?><?php if ($zurb_foundation_top_bar == 2) print ' show-for-small'; ?>">

One small nitpick and more of a question. Should this conditional logic be placed in a template file?

alexweber’s picture

@chris, good call man, I'm gonna move that to the preprocess instead

alexweber’s picture

New patch attached with the following changes:

  • Moved extraneous logic from page.tpl.php to template.php
  • Added extra settings for main top bar config: contain to grid, sticky and also for mobile menu text
alexweber’s picture

Has anyone had a chance to look at this? I've got an itchy trigger finger to commit this and address eventual changes as follow-ups... this branch is in dev anyway right? :)

chrisjlee’s picture

Assigned: alexweber » Unassigned
Status: Needs review » Fixed
FileSize
9.39 KB
chrisjlee’s picture

FileSize
55.19 KB

Forgot to attach new fun screenshots:

Selection_001.png

Thanks Alex!

alexweber’s picture

woohooo!!! :)

damiandab’s picture

Could someone explain me please how I get to work mobile menu bar? I click on menu and nothing happen.
I don't see also my menu items. Screenshot attached.

Best,
Damian

damiandab’s picture

Priority: Normal » Major
Status: Fixed » Active

In mobile-mode clicking on the button [menu] nothing happens; the menu-items don't appear.

alexweber’s picture

@damiandab Please don't cross post! This issue is only for adding the settings. You already mentioned this isn't working here: #2022631: Top Bar Menu doesn't inject class "expanded" in code when clicked

Thanks

alexweber’s picture

Priority: Major » Normal
Status: Active » Fixed

As far as adding new settings go, everything's fine!

Let's follow-up in the other issue.

damiandab’s picture

Hi Alex,

I'm sorry for crossing. I will follow another post you mentioned.

Best,
Damian

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

paskainos’s picture

Sorry for cross-posting. I found shumushin's #2005236: Menu rendering implementation first, and then I found this post. Is there a prescribed method / best practice for adding the 'button' class to links in the alt_main_menu and / or alt_secondary_menu 'menus'? @shumushin's patch from the aforementioned issue (although for D8) looks promising to that end. Any ideas?

paskainos’s picture

Issue summary: View changes

Hey Alex, I was wondering if it would make sense to add a fixed / sticky option (or ?) for the top bar. The primary reason being, when the top bar (i.e. main / secondary menu(s)) is positioned at page top always, the styling changes on scrolling when the 'sticky' class is removed, and the 'fixed' class is added. In order to maintain consistent styling, I changed 'sticky' to 'fixed' in the sub-theme template.php file. But I was curious what your thoughts on protocol were.