Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Jared 2 posts 72 karma points
    Feb 07, 2019 @ 13:11

    Best way to add text/javascript block and iFrame to a site?

    Hi everyone,

    New to using Umbraco and would really appreciate some advice regarding embedding iFrames to a site.

    I have the following to add to the < head >

    < script> src="*lang=en&k=f9e0bec95db28fc=companyname&d=website&view=list" type="text/javascript"> < / script >

    Then this following to add to the < body >

    < div id-"inrecruiting_announces">< / div>

        SeparatoColor: "AAAAAA",
        filterColor: "494444",

    Based on what I've researched so far I assume I need to add the < head > script in the relevant page template under settings, then create a partial view macro file for the body script to then reference as a macro. However I'm a bit lost in terms of how to format the partial view macro file or if there is a better way of doing it?

    Thanks in advance, if any further detail helps just let me know.

  • louisjrdev 107 posts 344 karma points c-trib
    Feb 07, 2019 @ 17:13

    I would create 2 fields on your doctypes both textareas, call one Head Scripts and one Body Scripts and then in your master template you can call each of them like so:


    you can then add your scripts (in html script tags) into these fields in the backoffice and they will display on the site (dont forget to null check)

  • Jared 2 posts 72 karma points
    Feb 08, 2019 @ 09:03

    Hi Louis,

    Thanks for your response, really appreciate it. I've added the script with the method you described, however upon previewing the changes I'm receiving the following error message where I expect to see the script result:

    "Warning: vacancy not found"

    Could you advise what could be causing that please?


  • louisjrdev 107 posts 344 karma points c-trib
    Feb 08, 2019 @ 09:10

    looks unrelated, nothing with the code i specified would cause that error, assuming a normal umbraco setup

Please Sign in or register to post replies

Write your reply to: