Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
A customer wants to add javascript snippets to the page, and I have set up a textarea property on the document type. Problem is, only part of the script is generated on page
The script:
This is generated:
Code I use:
@Umbraco.Field("globalTrackingScript", recursive: true)
I also tried using
@Html.Raw(Model.Content.GetPropertyValue<string>("globaleTrackingScript", true))
same result.
I can see the complete script in the database.
Is it a bug, or am I doing something wrong?
Hi Arild,
We had a simular issue a while back. We had to cast the field output to string before rendering it in Html.Raw. Hopefully this also fixes your issue.
string scripts = Umbraco.Field("globalTrackingScript", recursive: true).ToString(); if (!string.IsNullOrWhiteSpace(scripts)) { @Html.Raw(scripts); }
Thanks for the reply, but unfortunately that didn't work. Same problem.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Javascript in document property (Umbraco 7.2.8)
A customer wants to add javascript snippets to the page, and I have set up a textarea property on the document type. Problem is, only part of the script is generated on page
The script:
This is generated:
Code I use:
I also tried using
same result.
I can see the complete script in the database.
Is it a bug, or am I doing something wrong?
Hi Arild,
We had a simular issue a while back. We had to cast the field output to string before rendering it in Html.Raw. Hopefully this also fixes your issue.
Thanks for the reply, but unfortunately that didn't work. Same problem.
is working on a reply...