I'm trying to use a script and link tag in the TinyMCE editor for pieces in my portfolio. The issue is no matter what I do they keep getting wrapped/removed.
I found this link but it is for Umbraco 4 and doesnt work in version 7.1.4. Anyone have an idea how to do this?
You should be able to add links in to the TinyMCE. If you donĀ“t have the option in the tool bar of your TinyMCE, then you need to go to the developer section (if you have access) --> data types, find the data type for the RTE, in ther you can configure what options the user should have.
Sorry I misunderstood the part of the link tag, you mean of course a link tag to a stylesheet. If there a special reason why you need to be able to link to javascript and a stylesheet for example.
Maybe you can use the approach where to use the textbox multiple to place the javascript or link tag in.
The textbox multiple will not strip any of the script that you inserted into it.
Yes, a link and script tags. The textbox doesnt work. The script does not load a src or execute js between the tags. The link tag doesnt load its href from the textbox either. When I check the page html, it never gets to the page.
Alternatively I'm not really fixed on getting this done in TinyMCE. If there was a code block plugin or something like that that would allow me free reign to put html/js/css would work.
Using Script or Link Tags In TinyMCE
Hi All
I'm trying to use a script and link tag in the TinyMCE editor for pieces in my portfolio. The issue is no matter what I do they keep getting wrapped/removed.
I found this link but it is for Umbraco 4 and doesnt work in version 7.1.4. Anyone have an idea how to do this?
Hi Dan,
Here is a thread, about the same topic adding javascript in TinyMCE. http://our.umbraco.org/forum/umbraco-7/using-umbraco-7/57497-RTE-and-javascript
You should be able to add links in to the TinyMCE. If you donĀ“t have the option in the tool bar of your TinyMCE, then you need to go to the developer section (if you have access) --> data types, find the data type for the RTE, in ther you can configure what options the user should have.
/Dennis
Hi Dan,
Sorry I misunderstood the part of the link tag, you mean of course a link tag to a stylesheet. If there a special reason why you need to be able to link to javascript and a stylesheet for example.
Maybe you can use the approach where to use the textbox multiple to place the javascript or link tag in.
The textbox multiple will not strip any of the script that you inserted into it.
Hope this could be a solution for you.
/Dennis
Yes, a link and script tags. The textbox doesnt work. The script does not load a src or execute js between the tags. The link tag doesnt load its href from the textbox either. When I check the page html, it never gets to the page.
Alternatively I'm not really fixed on getting this done in TinyMCE. If there was a code block plugin or something like that that would allow me free reign to put html/js/css would work.
Hi Dan,
You can use the Textbox Multiple http://our.umbraco.org/documentation/using-umbraco/backoffice-overview/property-editors/Built-in-Property-Editors/Textbox-Multiple
And lets say you give the field a alias of script, then if you are using dynmaic razor you can do this:
And in strongly typed razor your can use this:
The @Html.Raw outputs the value unencoded, so you wil get the script tag out and link tag to the stylesheet. If you have access to the Umbraco TV, you can find a video about @Html.Raw here: http://umbraco.tv/videos/implementor/working-with-umbraco-data/razor-syntax/htmlraw/
Hope this helps,
/Dennis
Hi Dan,
An option could also perhaps be to use the SimpleCodeEditor from Kraftvaerk, for you javascript and link tag.
http://our.umbraco.org/projects/backoffice-extensions/kraftvaerksimplecodeeditor
/Dennis
Thanks Dennis, your the man!
I know that this is an old topic, but just provided a solution for another Umbracian solving exactly this problem.
Feel free to check it there: https://our.umbraco.org/forum/using-umbraco-and-getting-started/77417-cannot-insert-a-mailto-link-in-the-rich-text-editor#comment-247580 :)
is working on a reply...