strapi-plugin-navigation icon indicating copy to clipboard operation
strapi-plugin-navigation copied to clipboard

Feature Request: provide an option to disable/hide the URL on internal links

Open luxterful opened this issue 3 years ago • 9 comments

In my strapi setup i have an entity type called "Page" which has an href as required argument. With this argument i will render all available pages.

In my frontend framework (Nuxt): If there is a request i will take the path and search for it in all pages. If no page was found i will trigger an 404.

In this setup i don't need the URL on the Navigation Element because i can get it from the refered entity. Do you plan to add an option to disable/hide the URL option on internal links?


Btw: Thank you so much for this Plugin. Was looking for sth like this a year or so.

luxterful avatar Feb 09 '22 12:02 luxterful

A tricky question @luxterful ;) But it might be considered as an option. If I get you correctly, you would like to:

  1. entirely turn off url creation for your nav items
  2. return the url based on related entity or just keep it as part of related field?

cyp3rius avatar Feb 10 '22 07:02 cyp3rius

@cyp3rius yes, both options would work :)

luxterful avatar Feb 10 '22 09:02 luxterful

Hi, I really like this plugin. Any chance that you implement this feature? I really like the second idea. Same like title pulls from related entity.

mariansimecek avatar Apr 05 '22 06:04 mariansimecek

@mariansimecek yep, we've got it in our backlog just after the i18n and custom metadata support :)

cyp3rius avatar Apr 05 '22 06:04 cyp3rius

We would also really appreciate this feature! (We would you both options options on our projects, but mostly the second one). I'm really glad for this plugin, I found it just now, and immediately tried if this feature is available. I hope it will fit our needs, because we tried to create navigations just by Strapi content types and relations in at least three different ways on different projects, and it was painful (and it still is painful for content admins).

I see that i18n is available, I'm not sure about custom metadata and if you are still working on it, but do you have some estimated time of releasing this feature? Thanks for your work!

radoslavzeman avatar Jul 27 '22 21:07 radoslavzeman

I'm working this week on testing and finalizing a big bundle of features that will come in version 2.2. I hope that it will be available as a release next week.

ltsNotMike avatar Jul 28 '22 07:07 ltsNotMike

I also second that feature. In case of internal links, collection types usually contain slugs which will form the final url of the page. That's why having separate url entry field is redundant. In my project I have to either enter bogus data into url field when I have internal links or hack the package to ignore identical '/' urls.

dmitrysmagin avatar Aug 05 '22 15:08 dmitrysmagin

@dmitrysmagin In the latest version of the plugin you should be able to configure field that will be automatically passed as internal path. This way you don't have to care about populating path field. Hope this will help your use case.

ltsNotMike avatar Aug 06 '22 11:08 ltsNotMike

@ltsNotMike Thanks, you were right. Though, url and title fields are not filled instantly when you choose Content Type and Entity, but only after you press Save on the form. And more: once those fields are auto-filled, they are not re-filled when you change the Entity, you have to delete them first prior to saving. Dziękuję za pomoc.

dmitrysmagin avatar Aug 06 '22 14:08 dmitrysmagin

Hello @ltsNotMike, and thanks for your plugin!

But same problem here, I configured the plugin to populate Title as Name field, and Slug as Path field, and it doesn't populate the fields when the entity is selected, and when I try to save, I can't because the URL field is required...

The excepted behaviour is if you choose to populate the Name and Path fields, when you create a new internal menu item, and select an entity, it should be populate the Title in the Title field, and Slug in the URL field. ​ image

image

And last little UX suggestion: maybe there is an inconsistency between the names of the input fields in General settings and the New navigation item? Maybe this would be more consistency: TitleName, and ​URLPath (or the opposite)

Thanks!


edit: I just discover that it doesn't work with pages created before the plugin configuration, but for pages created after, it's working! (excepted that i have the same comments as @dmitrysmagin in https://github.com/VirtusLab-Open-Source/strapi-plugin-navigation/issues/152#issuecomment-1207219938)

maximelebreton avatar Nov 08 '22 09:11 maximelebreton

Hi @maximelebreton, Nice to hear that you enjoy the plugin. I will try to improve this feature when I'll find some time. Could you describe the steps to reproduce this behavior in other words? I'm not sure I understand the before and after configuration.

ltsNotMike avatar Nov 08 '22 16:11 ltsNotMike

Hello, we really enjoy this plugin, but not being able to disable the url fields can be quite annoying. We are using url-alias and it is not possible to use that as path default. The best solution for us would be if you could just disable the field.

Alexnortung avatar May 09 '23 08:05 Alexnortung

Released as part of 2.4.0.

cyp3rius avatar Feb 08 '24 16:02 cyp3rius