Replies: 4 comments 1 reply
-
Yeah, I need this functionality, but it seems like it's not possible yet. A quick fix would be a JS script that inserts the target="_blank" attributes on page load. I solved it with the following script: const links = document.querySelectorAll('.prose a')
links.forEach(link => link.setAttribute('target', '_blank')) But it applies to all links, maybe it's not what you need. You can change the selector for the links in the It would be nice to have this option built in, my clients often report it as a bug when they try to access the links and it does not opens in a new tab. This is a very old discussion, I hope this is implemented some day. |
Beta Was this translation helpful? Give feedback.
-
I achieved this using event handlers but it would be nice to have it built in.
|
Beta Was this translation helpful? Give feedback.
-
Not sure if this will help anyone, but figured I would share. We had the same issue when creating links for an item in a relation manager. Obviously, this can be adapted to be on the parent component, but it is done on save as opposed to changing it on the front-end. "content" is the name we assigned on the form component in filament. The main idea is to change the form data before it is saved to the database or as it is being used.
|
Beta Was this translation helpful? Give feedback.
-
You could do something like this on your model, assuming your field is called content:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm wondering if there is a way to add the target attribute to the RichEditor > Add Link > Target > "_blank".
I switched from plain Textarea to RichEditor to write content and that functionality is useful when you need to add links for an external page.
If there is a hack/quickfix I will take it too :)
Thanks for the help!
Regards,
Sebas
Beta Was this translation helpful? Give feedback.
All reactions