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

Support for other menus #111

Closed
wants to merge 4 commits into from
Closed

Support for other menus #111

wants to merge 4 commits into from

Conversation

ashmckenzie
Copy link

Hi Graham,

I had the need to create a categories.txt (in the same style as menu.txt), so made a few minor changes to support this.

Hopefully it's a desirable change.

Ash.

menu.txt is still the default, but other menus can now be read.
@gma
Copy link
Owner

gma commented May 21, 2012

Hi Ash. Thanks. Does this allow you to setup menus that can't be produced by including whatever menu hierarchy you like in menu.txt, and then using the menu rendering helpers to render just a small part of the full menu.txt file?

@ashmckenzie
Copy link
Author

Hi :) I'm using the menu.txt for page links and wanted to keep links to page / article categories separate. I tried to work menu.txt to my needs but it didn't seem like a logical fit. The site I'm working on is http://new.ashmckenzie.org/ (still a WIP)

Happy for advice on how I might be able to achieve this using the existing heleprs ?

@gma
Copy link
Owner

gma commented May 21, 2012

Have you tried having two different sections in your menu.txt file, and calling Nesta::Menu.for_path('/a-section') in your view? You should be able to maintain two completely separate menu hierarchies that way...

Site looks nice, btw.

@ashmckenzie
Copy link
Author

Sorry for the (very) late response. Thanks for the suggestion, I tried it but it didn't work for me as in my case the contents of my categories.txt are located at the root level:

euro-trip-2010
mongo
ruby
devops
display_menu(Nesta::Menu.for_path('/', 'categories.txt'), :levels => 1)

See the menu.txt entries on the left and the categories.txt entries on the right - http://ashmckenzie.org/

@travisbot
Copy link

This pull request passes (merged c58158a into 025188a).

@gma
Copy link
Owner

gma commented Oct 23, 2013

I'm going to have a think about whether or not this can be done sensibly with a single menu file. I'm not massively comfortable with the proliferation of lots of .txt files in content (perhaps they should be .menu files). Thinking about it…

In the meantime, I'm going to close this issue to things tidy and help me get the next release out of the door.

@gma gma closed this Oct 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants