-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom field: Link #16
Comments
I would really like this feature too, but how do you think this could be implemented. The current state of custom fields does not allow for usage with relations. I think this could be solved by just saving the id of the url alias as a number, but this gives another problem, when fetching the entity which uses the custom field, you would also need to fetch the actual url alias by id. Else it should somehow be automatically populated, but I am not really sure how this would work. What do you think? |
I've thought about this before, and think I have a decent solution. Proposal I suggest we introduce a specific string format to establish this relation. In the admin panel, the custom field will act as an autocomplete. Allowing you to select an URL alias by referencing it's corresponding content entry. On the API side we can use an entity service decorator to rewrite the Downside On the contrary I think we can't get around this with the current custom relations field restriction. And also allowing both URL alias relations and just hard-coded URLs is something that wouldn't be able at all with a relation field. So for that feature I really don't see any other way. @Alexnortung let me know what you think. |
I like the idea and I can definitely see that it could work. I have some thoughts that we might need to take into consideration. We are kind of introducing a new concept of hard coded urls (and external urls) which I think is very nice for this plugin. But I think we should think about storing those as individual entries in the database as well, maybe something similar to
In regards to the We should also consider if the links should be populated by default. I think that there are some cases where you don't necessarily need the link, however I am not sure the tradeoff is worth it. |
Feature request
Summary
As of now custom fields are still in Alpha, though when the custom fields are stable I think this plugin could benefit from registering one of it's own custom field types: Link.
Why is it needed?
This plugin effectively attaches a URL to a record in Strapi. So when you want to link from one page to another, you're gonna be looking at the URL path to link to. Having said that it makes sense to have a "Link" custom field type that is a reference to a specific URL path record. This field can for example be used as a button field to link to another page.
Having it set up this way when you start changing URLs the links keep working, as it is still a reference to the same URL path record that belongs to a specific page.
Suggested solution(s)
A custom field type named "Link" which is a reference to a URL path.
The text was updated successfully, but these errors were encountered: