Why is the URL required for wrapper elements ? #381
Replies: 6 comments 2 replies
-
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. |
Beta Was this translation helpful? Give feedback.
-
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... |
Beta Was this translation helpful? Give feedback.
-
hey cyp3rius, sorry to ping you, could we have your thoughts on this ? Do we have a good reason to "always" have this field ? |
Beta Was this translation helpful? Give feedback.
-
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? |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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/ |
Beta Was this translation helpful? Give feedback.
-
Hey there,
I'm failing to understand why is the URL required for wrapper elements :
Is there an option to remove this required field when the item is a "wrapper"?
Thanks !
Beta Was this translation helpful? Give feedback.
All reactions