Skip to content

Conversation

@infograf768
Copy link
Member

Following on #25929

Summary of Changes

Adding similar code from #25929 in mod_submenu to get the badges

Testing Instructions

Create a multilingual site. use multilingual sample data.
Click on the dashboard icon on the Menus line in the sidebar menu.

Before patch

No badges for Menus containing a Home menu item.

Screen Shot 2019-08-20 at 14 45 54

After patch

Badges are now displayed.

Screen Shot 2019-08-20 at 14 46 23

@infograf768 infograf768 changed the title [4.0][Admin template] Menu Dasboard: Display language badge for menus containing home [4.0][Admin template] Menu Dashboard: Display language badge for menus containing home Aug 20, 2019
@brianteeman
Copy link
Contributor

Is it just me that finds this confusing.
Looking at the screenshots I read it as showing Fr-fr on any french menu. Its not clear that its only for the menu that contains the default menu item for the french language

@infograf768
Copy link
Member Author

infograf768 commented Aug 20, 2019

Looking at the screenshots I read it as showing Fr-fr on any french menu. Its not clear that its only for the menu that contains the default menu item for the french language

This is done by multilingual sample data on purpose.
The badges concern menu with homes

@brianteeman
Copy link
Contributor

I think/hope you misunderstand me as I wasnt clear - trying again

Looking at the screenshots I read it that the new badge FR-fr should show on any french menu. Its not clear that its only for the menu that contains the default menu item for the french language

just a suggestion but perhaps display the Star and the badge perhaps on the default menu for that language

or even better display the badge on all menus that are language specific and the badge + star on the default

@infograf768
Copy link
Member Author

You still don't understand.
The code between parenthesis (fr-FR) in for example Menu Auteur (fr-FR) is resulting from multilingual sample data.
The specific badges JUST concerns Menus which contain a home whatever the language, including a Main Menu containing a Home with language All.
These badges replace the flags we have in 3.x.
Same for the Sidebar Menu...

@brianteeman
Copy link
Contributor

brianteeman commented Aug 20, 2019

I absolutely understand - pretend that sample data is not being used or the menus do not have the text in parenthesis. I am only talking about the badges

@infograf768
Copy link
Member Author

A menu may have any name and contain any type of menu items.
For example, I can have a menu called Special which will contain menu items tagged to various languages and which module is tagged to ALL and therefore display whatever the Content Language in use...
This is purely the decision of the user to give a name to a menu.
Usually in a multilingual site, clever users give a title in the same Content Language if all items and module are tagged to that content language.
Or use the parenthesis trick when obvious.

Please let's not reinvent the wheel. This is a loss of time.

@jeckodevelopment
Copy link
Member

Basically, from my understanding, the badges are now displayed instead of displaying the flag as we do in 3.x
Rigth?

Copy link
Member

@HLeithner HLeithner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if we have different language homes in one menu?

@jeckodevelopment
Copy link
Member

What happens if we have different language homes in one menu?

In J.3 you can't have more than one home in a menu.

@HLeithner
Copy link
Member

Yes but we had a discussion to change this. There is no technical reason why we should have only one language home menu item in a menu.

That's the reason I ask.

@infograf768
Copy link
Member Author

infograf768 commented Aug 23, 2019

@jeckodevelopment

Basically, from my understanding, the badges are now displayed instead of displaying the flag as we do in 3.x
Rigth?

Exactly, same we are now getting for the Sidemenu:

Screen Shot 2019-08-23 at 15 36 36

@HLeithner

There is no technical reason why we should have only one language home menu item in a menu.

Indeed there was a discussion and nothing concrete was proposed... as it would be extremely confusing imho (one would never know in which menu is a specific Home).
Also, we would have in the same Menu all menu items for the languages with Home that should be displayed by this Menu.

This patch has the merit of being consistent with what we have now.

@richard67
Copy link
Member

I've tested, and I've also tested what happens when we have more than 1 home in 1 menu, e.g. the "all languages" and the French homes in the "Main Menu".

  1. Without this PR applied:

Unbenannt-1

  1. With this PR applied:

Unbenannt-2

And in the menu we get with and without this PR:

Unbenannt-3

As you can see we have duplicate entries for "Main Menu" in any case, but in fact it is only 1 menu.

So this PR here does not introduce any new problem with it.

And so solving display of menus with multiple homes is another issue which should be solved as soon as there is a decision if such thing shall be officially supported.

@richard67
Copy link
Member

I have tested this item ✅ successfully on 2f5bda6


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25944.

@HLeithner
Copy link
Member

maybe a dump question but wouldn't it look better if the language tags are right aligned?

@infograf768
Copy link
Member Author

infograf768 commented Aug 25, 2019

maybe a dump question but wouldn't it look better if the language tags are right aligned?

We could reach this goal by adding a float: right; margin-right: 1rem; (float: left; margin-left: 1rem; in rtl to the badge . This means creating a new class.

  .home_badge {
    float: right;
    margin-right: 1rem;
  }

Then we would get this

Screen Shot 2019-08-25 at 08 31 43

If it is what you want I can do.
I just wonder in which scss I should add the new class. In _sidebar.scss ?

Note: I would not do that type of change in the sidemenu as it is already very narrow.
Also, remark that the star for the main Menu containing the Home set to ALL is not perfectly aligned.

@richard67
Copy link
Member

No, right-aligned doesn’t really look better.

@HLeithner
Copy link
Member

yeah seams not much better

@infograf768
Copy link
Member Author

@HLeithner
Please get this one in as there are going to be some changes for mod_submenu

@HLeithner
Copy link
Member

Thanks adding badges back.

@HLeithner HLeithner added this to the Joomla 4.0 milestone Aug 28, 2019
@HLeithner HLeithner closed this Aug 28, 2019
@infograf768 infograf768 deleted the 4.0_dashboardmenu branch August 28, 2019 07:08
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.

7 participants