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

Fix problem with lack of Navigation Menu #106

Open
stpaultim opened this issue Jun 21, 2024 · 5 comments
Open

Fix problem with lack of Navigation Menu #106

stpaultim opened this issue Jun 21, 2024 · 5 comments

Comments

@stpaultim
Copy link
Member

The readme says

Profit! The examples would appear in your Navigation menu if there was one. (Since we've removed the navigation menu in Backdrop they won't appear anywhere until somebody updates the code.)

What does it mean, "until somebody updates the code."?

I've spend quite a bit of time tonight trying to use these modules to understand how menu items are being created. I'm tempted to try and help fix this problem, but I need some tips on what the fix is?

I guess, since there is no Navigation Menu, we need to start by deciding where these menu items should show up?

@stpaultim
Copy link
Member Author

stpaultim commented Jun 21, 2024

I took a wild guess at one possible answer for the page example module. I submitted a PR and would love some feedback.
#105

@avpaderno
Copy link
Member

I find that sentence a little "fuzzy": It is not clear if code needs to be changed in Backdrop core or in the Example modules.

IMO, the hook_menu() implementations done in the Example modules should use a visible menu. After all, the Example modules are... example modules. Their menus do not need to be hidden; they should be visible, as they are installed on a local site.
Once that is done, that sentence is no longer necessary.

@avpaderno
Copy link
Member

While I think the routes added from the example modules should be visible in a menu, I prefer not to show them in the Primary navigation menu, where other menu items could be present. Instead, I would show them in an Examples menu create by the Examples for Developers module, which essentially is the main module for this project.

@stpaultim
Copy link
Member Author

stpaultim commented Jun 23, 2024

As for the menu not showing up, isn't this a problem with all the submodules?

Yes, to my knowledge this is a problem for all submodules. I think that the problem is that currently all submodules are creating links on this internal hidden menu and that we need to decide what the best alternative would be for Backdrop CMS.

I would prefer a page with links for each reachable page created by each submodule, but that could be my personal preference.

I'm a little unsure of exactly what you are suggesting here. Links need to appear on menus, so the question is which menu to add links for the example menu. Having these links on a page is not helpful, unless there is a link in the main menu to that page.

If you could do a PR with a example of what you have in mind that might be helpful. But, I will also try to work on a suggested solution.

@docwilmot Do you have thoughts on this?

(Responding to comments posted in: #105)

@docwilmot
Copy link
Member

To get examples module links to appear in a menu, we We have two main options I can think of:

  1. We write new code in every single examples module, which is reasonable, since they are meant to be used independently.
  2. We make all the Example modules dependent on examples.module, in which case we can put code in just that module that applies to all examples.

If we choose either of the above, we could:

a. create a new menu to put example links into (this would need to be done in every single Example, if we choose 1 above)
b. create a root Examples menu link in Admin Bar (although Admin Bar is already a bit crowded TBH) (this would need to be done in every single Example, if we choose 1 above)
c. use an existing menu path, such as for example admin/config/development/. (same)

I'm partial to 1+C. Change all links to admin/config/development/examples and add to every Example:

  $items['admin/config/development/examples'] = array(
    'title' => 'Examples',
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );

But 2+C is close too.

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

No branches or pull requests

3 participants