hyper
hyper copied to clipboard
Ability to give links a default value
What are you trying to do?
In the website I'm building I have a link to an external page that I need to reuse throughout the whole website. Would love to be able to define a fixed link as a default value that isn't editable by the others, but they would just be able to select the link type & know the url will be fine. Bonus points for having the possibility of setting that value with Craft values, in a global for example.
What's your proposed solution?
Have a "fixed" link type where you predefine a link that isn't editable by authors.
Additional context
No response
For this sort of thing, is there any value in using Hyper at all? I imagine you don't want users picking another link type? And a default link would be different to a fixed link value - the former being editable, the latter not.
I'll consider it for sure, but there's probably very little value Hyper can add as opposed to using a read-only Plain Text field for this sort of thing.
So, the scenario is the following: I'm using Hyper for "link groups", let's say 2 CTA's at the top of a page. Link 1 goes to the product signup link (which is the fixed URL I was referring to) which is on a different subdomain & not related to Craft, the 2nd CTA is a link to an actual Craft page. It seems Hyper is the right way to go here, since the lovely multiple link functionality + custom attributes. This leaves me however in the situation that people always have to look up the the signup url & there is some room mistakes there.
I don't mind them picking other urls or links to other Craft pages, I just want to make it as easy as possible for them to be able to link easily to a url we'll be using throughout the whole website.
I have a similar use case where there's the option for 2 CTAs and either could be set to a URL, Entry page, or third-party modal. The modal would require a link value set by me/the developer not the user to open the modal (ideally using Twig, such as {block.id} or something), but the user would still be able to set the link text and there'd be a separate field for the modal code (in this particular case it comes from Wistia).
Jotting a note here to remind me that we'll need to employ something similar to default table rows to be able to handle multiple links. It won't be enough to just define the default value in the link type.