I've created a quiz on the website quiz-maker.com and I want to embed it onto my web page using the text editor. However, when I paste in the embed code using the source code option, it doesn't seem to load. Is this because it involves using script tags? Please could someone help me to embed this?
I should probably also point out I am very new to Umbraco!
I'm sorry I don't completely understand what I need to do.
I have the embed code in the text area on my content page. And then the
@Html.Raw(Model.YourPropertyAlias) goes in the View template?
I can't seem to locate where that is. Sorry if I'm being dumb here.
it sounds like you're using a rich text editor - not a text area.
Are you an editor with an Umbraco site or are you doing the development with it?
Rich Text editors tend to mess with markup that you paste in and will likely filter the script tags. If you can, I would use a separate text area instead to add this embed code.
Then you need to go and edit the template (view) to output this new text area with the razor code I gave you above.
Does that make more sense? Do you have access to the Settings / Developer sections in Umbraco?
I am editing from the back end of an Umbraco site, not on a rich text editor.
I've added in the code into its own text area, using a text widget.
I do have access to the Settings/ Developer sections, but I don't know my way around it very well, so I'm not sure where that razor code should go. I placed it in the Standard Page template (Views/StandardPage.cshtml) and all I got was runtime errors so I took it out again!
Yes - that is the rich text editor - the field "Text" is using a Rich Text Editor. In Umbraco you can add extra fields.
I would recommend you add a new field to this document type
Go to Info tab and you'll see Document Type on the right - click the open link.
You'll see your document type and will be able to add properties. Let's add one to the Widgets tab. Give it a name "Embed Code" and choose the Editor (click Reuse and find TextArea).
Save this - this won't do anything until we add it to your template.
So go back to your Lookup page and then back on the info tab see what template is being used (same deal - click Open).
Then find where your Text field is being output.. and give me another screenshot so we can write the bit of Razor for you.
If you're feeling brave you can try pasting this below the Text.
Before you do anything copy the contents and save them to a text file somewhere local.
But if you add a return after the closing brace } on line 22 and add that line I gave you it should work.
Probably worth pointing out here that if you have developers that work on your site you'll need to let them know about this change as if they release something it will likely over write this.
Embed code not working
I've created a quiz on the website quiz-maker.com and I want to embed it onto my web page using the text editor. However, when I paste in the embed code using the source code option, it doesn't seem to load. Is this because it involves using script tags? Please could someone help me to embed this? I should probably also point out I am very new to Umbraco!
Hi,
You'd be best changing this field to a text area and ensure that you output the text in the View template with
The html raw tells razor not to encode your html and script tags.
I'm sorry I don't completely understand what I need to do. I have the embed code in the text area on my content page. And then the @Html.Raw(Model.YourPropertyAlias) goes in the View template? I can't seem to locate where that is. Sorry if I'm being dumb here.
Hi,
it sounds like you're using a rich text editor - not a text area.
Are you an editor with an Umbraco site or are you doing the development with it?
Rich Text editors tend to mess with markup that you paste in and will likely filter the script tags. If you can, I would use a separate text area instead to add this embed code.
Then you need to go and edit the template (view) to output this new text area with the razor code I gave you above.
Does that make more sense? Do you have access to the Settings / Developer sections in Umbraco?
Steve
Hi
I am editing from the back end of an Umbraco site, not on a rich text editor.
I've added in the code into its own text area, using a text widget.
I do have access to the Settings/ Developer sections, but I don't know my way around it very well, so I'm not sure where that razor code should go. I placed it in the Standard Page template (Views/StandardPage.cshtml) and all I got was runtime errors so I took it out again!
Can you post a screen shot of the text widget?
If you have a view source button that is most likely the rich text editor in Umbraco but let's see.
Let me know if you need me to see anything else.
Hi,
Yes - that is the rich text editor - the field "Text" is using a Rich Text Editor. In Umbraco you can add extra fields.
I would recommend you add a new field to this document type
Go to Info tab and you'll see Document Type on the right - click the open link.
You'll see your document type and will be able to add properties. Let's add one to the Widgets tab. Give it a name "Embed Code" and choose the Editor (click Reuse and find TextArea). Save this - this won't do anything until we add it to your template.
So go back to your Lookup page and then back on the info tab see what template is being used (same deal - click Open).
Then find where your Text field is being output.. and give me another screenshot so we can write the bit of Razor for you.
If you're feeling brave you can try pasting this below the Text.
Then if nothing is broken go and add your quiz code to this new field. Steve
I've opened the template that's being used, which has led me to here. I better not risk doing it myself!
Hi,
Before you do anything copy the contents and save them to a text file somewhere local.
But if you add a return after the closing brace } on line 22 and add that line I gave you it should work.
Probably worth pointing out here that if you have developers that work on your site you'll need to let them know about this change as if they release something it will likely over write this.
I'm assuming you don't have them though?
It works!!
Thank you so much for your help and patience! You're a star!
I'll let the digital team know I've added this in.
Thanks again!
Glad to help - send my apologies to the digital team.
They might not like this change - I probably should have asked if you had one!
Steve
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.