Tobias,
Thank you for all of your hard work, the plugin is great! Can you help me with one thing? How do I change the embedded links to open in a new window? I have looked through some of the files, but haven't had any luck.
Thanks,
Casey
Tobias,
Thank you for all of your hard work, the plugin is great! Can you help me with one thing? How do I change the embedded links to open in a new window? I have looked through some of the files, but haven't had any luck.
Thanks,
Casey
Hi,
do open links in new window, you'll need to change the HTML, that is added to a cell by the link helper.
Your link will look like this: <a href="http://www.example.com">text</a>
You need to append a target="_blank" here, so change the HTML to <a href="http://www.example.com" target="_blank">text</a>.
To achieve this for all links that you'll insert in the future, you'll need to change the appropriate code in the admin-script.js file to also add this target code piece. But be warned that these changes would be overwritten when updating the plugin.
I'll try to find a better solution for this though.
Best wishes,
Tobias
Hi,
I need to apply this feature so all links open in a new window.
you'll need to change the appropriate code in the admin-script.js file to also add this target code piece
Where is this file?
Thanks,
-Brian Prossrman
Hi,
Do you mean to create a file called admin-script.js saved in the folder wp-admin/js with the code text
-BrianP
code text
code
Hi,
I just read you response to my previous question from a few days ago. I didn't find the question when searching for it in the general Forum.
Your response was very helpful.I probably will take you advice and leave the link structure the way it is, but I in case I change my mind, it would be helpful to know how to apply the global means of opening a link in a new window.
The best!
-BrianP
Hi,
the file mentioned is the admin-script.js in the admin subfolder. However, that change is no longer necessary, as option in the backend is exactly the same (it was added after I made that post).
However, there is no possibility to add the new-window-opening to links after they have been created (and if the option was not set). This is because the HTML for the links is fixed in the cells and can only be changed manually. That's what I meant with the code above. You will need to look for such code for your links and eventually need to add the target attribute by hand.
Enabling the option will automate that process for all links that are created from then on only.
Best wishes,
Tobias
This topic has been closed to new replies.