Grid editor - rich text editor stripping hubspot form scripts
Can anyone help with how best to solve this...
We have the need to add hubspot forms onto out site, however when we add the script to the rich text editor umbraco strips the javascript out. When we add it to the includes section it adds it below the footer (and the correct form appears)
My question is how do we include scripts within the body of the page without Umbraco stripping the code out. Is there a way to include using the includes function but target the script to display it in a certain position on the page?
What I normally do when I need to let the user add some JavaScript to page. I created a separate field, using the multiple textbox, the documentation can be found here
Grid editor - rich text editor stripping hubspot form scripts
Can anyone help with how best to solve this...
We have the need to add hubspot forms onto out site, however when we add the script to the rich text editor umbraco strips the javascript out. When we add it to the includes section it adds it below the footer (and the correct form appears)
My question is how do we include scripts within the body of the page without Umbraco stripping the code out. Is there a way to include using the includes function but target the script to display it in a certain position on the page?
Many thanks
Hi Daniel,
What I normally do when I need to let the user add some JavaScript to page. I created a separate field, using the multiple textbox, the documentation can be found here
https://our.umbraco.org/documentation/using-umbraco/backoffice-overview/property-editors/Built-in-Property-Editors/Textbox-Multiple
And when you pull out the data from the field you need to use the @Html.Raw function
Hope this helps, and make sense.
/Dennis
Hi Dennis,
Thanks for the fast response.
We don't have that functionality on our version i don't believe. We are using the Grid editor for reference.
See the tool bar and rich text editor below.
Hi Daniel,
What I would do is to create a new tab or just put the new field under the an exstient tab, it could be e.g the options tab.
I there I will add a new field, that use the data type called multiple textbox and give it a name and a alias. The alias could be e.g scripts.
Then you will add this lines of code in your template where you want the code to appear it could be just before the body end tag.
If you are unsure how to add new fields then try to see these free videos. http://umbraco.tv/videos/umbraco-v7/implementor/fundamentals/document-types/properties/ and http://umbraco.tv/videos/umbraco-v7/implementor/fundamentals/document-types/data-types/
There are also many more videos that shows the basics working with Umbraco http://umbraco.tv/
Hope this helps, and make sense.
/Dennis
is working on a reply...