dropdown menu caret

91 views
Skip to first unread message

Josh Cartmell

unread,
Sep 17, 2012, 4:49:39 PM9/17/12
to mezzani...@googlegroups.com
I noticed that the caret in the dropdown shows up indicating a dropdown, even if none of a page's children show in the menu.  I'm not exactly sure how to go about it of the top of my head, but it seems that we may need another helper, something like has_children_in_menu.  Am I missing anything and/or does anyone have any ideas or comments?

Thanks,
Josh

Stephen McDonald

unread,
Sep 17, 2012, 4:56:12 PM9/17/12
to mezzani...@googlegroups.com
There's already a helper for it that's used and appear to work correctly for me:



--
Stephen McDonald
http://jupo.org

Josh Cartmell

unread,
Sep 17, 2012, 5:35:24 PM9/17/12
to mezzani...@googlegroups.com
Thanks Steve, I actually had seen that.  Right now page.has_children evaluates to true even if the children aren't in the current menu (so if about has a single child name team, but team doesn't show in the dropdown, about still gets the caret).

As an example if you look at the demo site right now, the 2nd item in the drop down menu has a title of "The home page."  It has the little dropdown caret next to it, even though it's only child is set to not show in any menus.

Stephen McDonald

unread,
Sep 17, 2012, 7:44:24 PM9/17/12
to mezzani...@googlegroups.com
Right that makes sense. It'll need a bit of a refactor in the page_menu template tag where it all happens - doesn't look like a simple change, but it definitely needs to be fixed.

Brian Schott

unread,
Sep 18, 2012, 10:40:01 AM9/18/12
to mezzani...@googlegroups.com
Are num_children and has_children attributes used by templates outside of the menu generation context?  Just concerned about side effects where those values change depending on what menu you happen to be processing.  

Also, I notice that the version of bootstrap in mezzanine is pre 2.0.  It might be time to think about updating bootstrap support, as there have been a lot of fixes and features added with 2.0.  I've upgraded our own site to 2.1, and it is working pretty well, but would love if we could just drop in templates from bootswatch an have everything just work style-wise.

Stephen McDonald

unread,
Sep 18, 2012, 4:36:17 PM9/18/12
to mezzani...@googlegroups.com
On Wed, Sep 19, 2012 at 12:40 AM, Brian Schott <brian....@nimbisservices.com> wrote:
Are num_children and has_children attributes used by templates outside of the menu generation context?  Just concerned about side effects where those values change depending on what menu you happen to be processing.  

They're only designed for use within menus, so I see this as a bug that needs to be fixed.
 

Also, I notice that the version of bootstrap in mezzanine is pre 2.0.  It might be time to think about updating bootstrap support, as there have been a lot of fixes and features added with 2.0.  I've upgraded our own site to 2.1, and it is working pretty well, but would love if we could just drop in templates from bootswatch an have everything just work style-wise.

Agreed. Hopefully it's just a matter of dropping in the new version.
 

On Sep 17, 2012, at 7:44 PM, Stephen McDonald <st...@jupo.org> wrote:

Right that makes sense. It'll need a bit of a refactor in the page_menu template tag where it all happens - doesn't look like a simple change, but it definitely needs to be fixed.

On Tue, Sep 18, 2012 at 7:35 AM, Josh Cartmell <joshc...@gmail.com> wrote:
Thanks Steve, I actually had seen that.  Right now page.has_children evaluates to true even if the children aren't in the current menu (so if about has a single child name team, but team doesn't show in the dropdown, about still gets the caret).

As an example if you look at the demo site right now, the 2nd item in the drop down menu has a title of "The home page."  It has the little dropdown caret next to it, even though it's only child is set to not show in any menus.


On Mon, Sep 17, 2012 at 1:56 PM, Stephen McDonald <st...@jupo.org> wrote:
There's already a helper for it that's used and appear to work correctly for me:




On Tue, Sep 18, 2012 at 6:49 AM, Josh Cartmell <joshc...@gmail.com> wrote:
I noticed that the caret in the dropdown shows up indicating a dropdown, even if none of a page's children show in the menu.  I'm not exactly sure how to go about it of the top of my head, but it seems that we may need another helper, something like has_children_in_menu.  Am I missing anything and/or does anyone have any ideas or comments?

Thanks,
Josh



--
Stephen McDonald
http://jupo.org




--
Stephen McDonald
http://jupo.org

Brian Schott

unread,
Sep 18, 2012, 4:47:55 PM9/18/12
to mezzani...@googlegroups.com
On Sep 18, 2012, at 4:36 PM, Stephen McDonald <st...@jupo.org> wrote:

Also, I notice that the version of bootstrap in mezzanine is pre 2.0.  It might be time to think about updating bootstrap support, as there have been a lot of fixes and features added with 2.0.  I've upgraded our own site to 2.1, and it is working pretty well, but would love if we could just drop in templates from bootswatch an have everything just work style-wise.

Agreed. Hopefully it's just a matter of dropping in the new version.

I'm supposed to be working on some PPT slides and text inputs for a proposal, but if I get some time next week I'll take a stab at packaging up what I have into a merge request.  I'd rather be coding right now :-).  There have were some threads on the templates refactor in the past and I was wondering if anyone else had successfully merged in the latest Twitter bootstrap.  I remember some discussions about modularizing the base.html template so you could more easily configure with just a few block overrides in using overextends.  I just completely replaced base.html in my current project because there were some missing blocks at different levels to make it easy.  Any inputs on how best to reconfigure mezz base.html to minimize adopters code?

Brian

Josh Cartmell

unread,
Sep 18, 2012, 6:12:28 PM9/18/12
to mezzani...@googlegroups.com
Might it make sense to simply add new attributes such as has_childre_in_menu and num_children_in_menu?  That way if someone cared about children regardless of the current menu they would have what they need (the current functionality) and if someone only wanted to know about the children relative to the current menu they would have that as well.

Thoughts?

Stephen McDonald

unread,
Sep 19, 2012, 8:06:05 PM9/19/12
to mezzani...@googlegroups.com
Yea this is a great approach - that way anyone relying on the old behaviour can still use it. 

Stephen McDonald

unread,
Oct 1, 2012, 2:48:23 AM10/1/12
to mezzani...@googlegroups.com
Finally got around to fixing this:


Thanks for raising it!

Josh Cartmell

unread,
Oct 1, 2012, 3:59:53 PM10/1/12
to mezzani...@googlegroups.com
Thanks Steve, sorry that I didn't get a chance to look into it myself.
Reply all
Reply to author
Forward
0 new messages