Replies: 7 comments
-
Hi @dgsiegel, you can control which sections the user can pick linked elements from within the field settings. You can disable those sections that do not expose an url there. Check the settings page of the individual link field you've created, you've probably selected the option to allow all sections. As users might do all kind of stuff with the information about the linked element, I don't think we should restrict the sections to only those exposing urls. |
Beta Was this translation helpful? Give feedback.
-
I know that I could choose the sections individually, but that is not feasible in this case as we use a high number of link fields. But that would be something for #47. The actual issue is the link being empty, something a user would probably not expect. After all, what's the reason for an empty link? What kind of use cases are you thinking about? |
Beta Was this translation helpful? Give feedback.
-
@dgsiegel I actually have a use-case for that - i have a section of entries that are reusable content for "modal dialogs". They aren't displayed on their own, hence they have no URLs. I am using the LinkField to be able to select those "modal" entries and assign them to a button (instead of a href) to open a modal with that entry content. I do get your point around the pain of having to modify multiple field instances to exclude them - I ended up configuring my desired settings on one field, and then doing some copy/paste work directly in the project config yaml files of the other field instances, and then doing |
Beta Was this translation helpful? Give feedback.
-
I do use a similar setup, but the correct field for that would be an entry field, not a Link field? |
Beta Was this translation helpful? Give feedback.
-
True - but the Link field gives me the flexibility for my button/action to link to either an entry with a url (eg a page), one with out a url (like a modal), or just a custom url.. |
Beta Was this translation helpful? Give feedback.
-
Okay, I think we definitely should not disable this but I can understand that it might be handy to have this as an option. |
Beta Was this translation helpful? Give feedback.
-
I also set up modals as entries and link to them using the link field, just like michaelroper described, so I'd also hate to see this functionality disappear! :-) |
Beta Was this translation helpful? Give feedback.
-
I do have a few sections which do not have a URL (empty site settings in the section configuration). With Link field you can still choose these sections if you enabled the selection of entries in a link. The result looks like the following:
Ideally, a user should not be able to choose entries without a URL.
Beta Was this translation helpful? Give feedback.
All reactions