Changing Behavior of Menu and Favorites Application Combination from 14.10.4 to 15.10.7

Hello everyone,

I wanted to share a change in behavior in the menu application where I am not sure if it is intentional or a bug. Wanting to upgrade to the newest LTS soon I used the code from my 14.10 instance which is the following:

* [[internal Wiki>>doc:internalwiki:Main.WebHome]]

* [[XWiki help>>doc:Main.How to\.\.\..XWiki help.WebHome]]

{{display reference="Favorites.Code.FavoritesMenu"/}}

with the result on 14.10 being the intended horizontal menu:
image

However, copying this code to my 15.10.7 test instance results in the following Menu:
image

Very different stacked positioning here. I tried fixing this with a number of code changes which the most promising being removing the empty lines:

* [[Home>>doc:Main.WebHome]]
* [[XWiki help>>doc:Main.Help.WebHome]]

{{display reference="Favorites.Code.FavoritesMenu"/}}

image

or like this

* [[Home>>doc:Main.WebHome]]
* [[XWiki help>>doc:Main.Help.WebHome]]
{{display reference="Favorites.Code.FavoritesMenu"/}}

image

But there was no change that was able to get the desired look of the first picture from 14.10 back. There is either a stacked menu or a buggy menu.
Any Ideas on how the syntax works now? Am I missing something? Does the favorites application maybe have to be changed?

Comparing the CSS between 15.10.7 and 14.10 I found that the following properties are new and make the difference:
image

However, I don’t really know what to do from here because there must be a reason for their introduction…

This PR made the change and it was about screenreaders

Hi @lukasM,
If you inspect with the browser tools you will notice that there is a list <ul role="menu"> that contains all the menu entries generated by using the wiki link syntax, so it doesn’t contain the items you include with the {{display}} macro.
The changes in the PR you mentioned are affecting the menu itself.
Also, using the {{display}} macro is not something expected by design, and it was a coincidence that it worked before.
Have you tried instead to add your Favorites link following the example of the first 2 entries?

1 Like

When I updated it for XWIKI-19725 I assumed menus would follow the default menu pattern.

I tried to test out your use case, and I can’t provide a definitive answer without knowing the content of the
Favorites.Code.FavoritesMenu doc you’re using in the content of the menu.

However it seemed that adding it as the third bullet point got me something more consistent with what you expect:

* [[Home>>doc:Main.WebHome]]
* [[XWiki help>>doc:Main.Help.WebHome]]
* {{display reference="Favorites.Code.FavoritesMenu"/}}

I did some other tests and it didn’t work so well with other types of content :confused:

All in all, the menu structure should be represented as an unordered tree.
Let me know how it goes and if there’s something broken even when you make sure the structure is a tree :slight_smile:

Thanks!
Lucas C.

Hi @acotiuga,
I don’t think that this working was a coincidence. Having the ability to place a per User favorites entry in the menus of the menu application is a documented feature of the Favorites Application . That is also why I cannot place the Favorites like the first entries are places - they are generated dynamically.

It looks like a compatibility issue that needs to be fixed in the Favorites application.
The minimal supported version is XWiki 10.6.1 and I cannot guarantee that the application was tested on newer versions of XWiki.
You can report an issue on Loading... with your detailed investigation.

This is part of the Favorites Application and just provides an unordered list of schema:

  • Favorites
    ** User Favorite 1
    ** User Favorite 2

Because of the favorites application already outputting an unordered list, using this introduces additional indenting shifting the inserted content further right, see here:
image
Due to the double indent the third entry does not work, there is nothing collapsed inside the arrow.
image

I think what should intuitively work is this:
image
which results in the following WYSIWYG:
image
for some reason we have the double indention of the inserted content from the display macro which should not be there since the content on the “Favorites.Code.FavoritesMenu” page displays:
image

I think this behavior is also the reason we had to use seperated lists like before like this to get the Favorites Application Menu Insertion to work.:

Not sure what to do here, I was able to fix it myself using a CSS Extension that sets the menu back to “display: inline” so I can update to 15.10.

I think if the menu stays like this the description of the Favorites Application has to be changed or maybe its a fix needed in that extension itself?

Thanks for the reply!

O okay, this might be the right place then.
Thanks, and I will open an issue shortly.