Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hey there,

I'm failing to understand why is the URL required for wrapper elements :

image

Is there an option to remove this required field when the item is a "wrapper"?

Thanks !

You must be logged in to vote

Replies: 6 comments · 4 replies

Comment options

What does that even do? I chose to link to a Page so I expected it to take that page's slug. I mapped Name and Slug to the page name and slug fields. I dont understand why we need to then add in the slugs in the menu if linking to an Entity. This unique URL part is then output as the slug, not the entry's slug.

You must be logged in to vote
1 reply
@atissedrescaleway
Comment options

I agree, it's confusing for my current strapi users, because they believed it was the actual url.

Still not really sure why we can't disable/hide this field.

Comment options

I am not fetching it in the GraphQL and I will have to tell the customer to ignore it, leave it empty to generate the slug from the page slug.

But I spotted 2 issues with this field also...

If you do accidentally fill it in, you cannot then leave it blank to re-generate again. So you'd have to go get the slug from the linking page. Or just enter any old random thing as we are not using it.

If you do actually use this field for the slug, when you change the slug in the Page, it does not then change in the menu. So there will be 404s, if people change slug names.

In my opinion its best to have the slug in the Page because of other ways of linking between pages, which is not only in a menu. So this field is quite unnecessary for many people and as you say confusing.

I am not sure when I ever set a page's slug in the menu item itself. Oh wait, I remember now.... 15 years ago I was using Joomla and the menu slug linking to a page confused me then too.

But I am sure there are reasons to, so it would be good to have an option to just not used it.

I also find "Attach to menu" confusing. Customers are going to get confused too. My menu items have Attach to menu = false. But they of course show on the front end as I have "menuOnly: false" in the query. But when items are added I guarantee people will select True because they think this will add it in the menu. So thats also doing nothing for us. But its extra steps. I would prefer it default to True, so the only time its needed is when someone does not want it to be in the menu. I wonder if I can set this in plugins.js...

You must be logged in to vote
0 replies
Comment options

hey cyp3rius, sorry to ping you, could we have your thoughts on this ?

Do we have a good reason to "always" have this field ?

You must be logged in to vote
0 replies
Comment options

Let me dig into that and check possibilities.

In short it would be fine for you if slug field is going to be hidden for wrapper type?

You must be logged in to vote
3 replies
@atissedrescaleway
Comment options

My original question was about the wrapper type, so, in short, yes !

And now that my menu is live in production (and working well), I realize I didn't need this field at all : even for internal and external types !

Is that something we could consider ?

Live example : in this menu, none of the 4 URLs I had to fill were useful for my frontend. The only URL we're using comes from the "Serverless Functions" Page entity.

(We're using it on https://www.scaleway.com/en/) :

image

@atissedrescaleway
Comment options

@cyp3rius Did you have the chance to dig, do you know if we could make this URL field optional ?

Our contributors are still a bit bothered, they have to fill this field for each entry even though it's not used anywhere

@cyp3rius
Comment options

Your case seems specific, some logic of the plugin is based on the URL field so we can't make it optional in general. Anyway you can amend the validation and schema by doing the Strapi Extension to the plugin, what is the advised way of doing that.

Comment options

I have finished building my menu and this is what i believe about the above...

URL for Wrapper - this is when you do not link to a page, but want to link internally somewhere. So for example, I do not have any page entry for "News", it loads a template file. So I cant link to it by choosing a content type. So I choose wrapper, then enter /news/ for the URL.

URL for External - you cant use this for a custom internal link because the validation is checking for https:// format I think.

URL for Internal - as discussed above I dont think this is necessary? If you want to enter a custom URL use Wrapper. So its a little confusing because its a Required field even when using Internal

Personally I think Wrapper and External should work the same and I can add a custom field for "Open in a new window or not".

Either way this is my interpretation now.

You must be logged in to vote
0 replies
Comment options

Another thing I have discovered is a nested menu will take the path entered into the parent menu. So a page called About with URL /about/ has a nested page called History with URL history/ then the menu URL becomes /about/history/.

So this is also not suitable if you use a slug field in a Page itself as the page URL. To fix it, you have to manually change the parent menu item to just / so the child page URL becomes /history/

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.