Jump to content

Menu Builder


kongondo

Recommended Posts

This bug has been already reported by one of my colleagues in 2021, but nothing has been corrected so far. If your profile is set in a language other than the default language, and you are building a menu with the MenuBuilder module, your menu won't appear correctly in the other language.

1639174403_CleanShot2022-11-08at15_34_29.png.ce07791ca729c0794681ba173637af93.png

If you switch back to the original language, you can edit it.

668728021_CleanShot2022-11-08at15_44_43.png.49293712e8586db9538c55635bf534dd.png

Also, the menu is pretty useless because it doesn't show correctly in pages.

935616135_CleanShot2022-11-08at15_53_52.png.c2bf052ec0adc3e151be1023c683c8b9.png

Which is a real problem in one of our actual project

1173005745_CleanShot2022-11-08at15_57_50.png.8769b0b687c4f45245d759d0b0b954c9.png

Is there a solution for that?

 

Edited by Spiria
Typo
Link to comment
Share on other sites

Hey @Spiria — just a heads-up that I have merged your post to the Menu Builder support thread. Official support thread is the best way to reach module author. Looking back to the report in 2021, it looks like that earlier report might've just gone unnoticed.

  • Like 1
Link to comment
Share on other sites

19 hours ago, Spiria said:

This bug has been already reported by one of my colleagues in 2021, but nothing has been corrected so far. If your profile is set in a language other than the default language, and you are building a menu with the MenuBuilder module, your menu won't appear correctly in the other language.

What @teppo said. Apologies this slipped under the radar. I'll have a look this weekend.

Link to comment
Share on other sites

19 hours ago, Spiria said:

Also, the menu is pretty useless because it doesn't show correctly in pages.

Not sure I understand this bit. Is it related to the 'switching user language profile' issue you've mentioned?

Link to comment
Share on other sites

On 11/17/2022 at 7:34 PM, Spiria said:

@kongondo Where you able to figure out what the problem is?

Hi @Spiria,

Sorry, didn't get a chance to look at it. There are two 'issues' you have reported:

#1 If your profile is set in a language other than the default language, and you are building a menu with the MenuBuilder module, your menu won't appear correctly in the other language.

I am working on a fix now. I hope to fix over the weekend. No promises though.

#2 if you build the menu with language in your profile other than the default language, the menu will not translate correctly to the language chosen by a visitor, as my examples show.

By default Menu Builder will display the title of the page as it was when it was added to the menu. If you want it to be dynamic depending on the current title and current language, you need to use the default_title option as documented here. For example:

<?php

namespace ProcessWire;

$menu = $modules->get('MarkupMenuBuilder');
// render the menu by title and show the current title of the page in the user's language
$content =  $menu->render('My Menu', ['default_title' => 1]);

 

 

 

Link to comment
Share on other sites

On 11/17/2022 at 7:34 PM, Spiria said:

@kongondo Where you able to figure out what the problem is?

Hi @Spiria

Could you please test version 0.2.8 currently on the dev branch? You will have to install it manually. It fixes the issue:

Quote

If your profile is set in a language other than the default language, and you are building a menu with the MenuBuilder module, your menu won't appear correctly in the other language.

Please let me know if it works. 

Thanks.

Link to comment
Share on other sites

Sorry for the delay. My colleague said the problem is solved in part:

When I add a page to a menu in another language than default, the url is now OK, but the title is displayed in the wrong language as before

A page with the site's page selector, not a custom addition.

 

Link to comment
Share on other sites

  • 2 weeks later...
On 11/23/2022 at 7:57 PM, Spiria said:

but the title is displayed in the wrong language as before

I don't understand this. 

  1. What title are you referring to? The titles of menus that are displayed in the dashboard that shows all Menu Builder menus in the backend?
  2. What is the wrong language in this case?
  3. A screenshot with English explanations would help.
Link to comment
Share on other sites

11 minutes ago, GEN- said:

Hi kogondo, I am a colleague of Spiria. In this exemple, the default language is French. if the profile of the user who modify the menu is english, the url of the item that will be displayed is correct, but not the title. 

 

Screenshot 2022-12-04 at 2.34.55 PM.png

Hi @GEN-,

Thanks for clarifying. Did you see my response above about this with respect to the option default_title?

 

 

Link to comment
Share on other sites

3 minutes ago, GEN- said:

Thanks Kogondo, I didn't see this comment. I just saw the one from November 20th talking about the version 0.2.8 on the dev branch. I just tried getMenuItems(1705, 1,['default_title' => 1]) and it works.

Thanks again

Glad you got it sorted! 😄.

By the way, I know there are some CSS issues that need fixing. Something changed in ProcessWire that is messing up the page selections. I have accepted a PR for this in the Project  in GitHUb and will be merging with dev 0.28 this week now that you have confirmed 0.28 works. Thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...