Copied to clipboard

Flag this post as spam?

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


  • James Hayward 17 posts 37 karma points
    May 26, 2017 @ 04:44
    James Hayward
    0

    How to insert Multiple Javascript Codes into a page/article

    Is it possible to get clever with macros to insert javascript codes

    Umbraco Version: 7.5.2

    Challenge: My content writers need to insert various "javascript codes" into their articles/posts/pages they produce. Each Article could contain different 1 - 3 different javascript codes each time from different products they are promoting.

    What is the easiest method to have the team insert this code? I was trying to do it via the macro insert in the RTE.

    Was wondering if it is possible by the Macro Insert that the team can paste their code and submit.

    Want to avoid creating a new macro for each different javascript code we use.

    Cheers James

    Hoping someone might be able to advise best course do this.

  • Ben 108 posts 374 karma points
    May 26, 2017 @ 12:40
    Ben
    0

    Hi James,

    I did something similar on my sites. I did this two ways:

    1. Created a custom field on the properties tab for Extra Javascript (could also be put in any other tab). This field is then pulled in on the template.
    2. Created a document for custom Html (only one field which is a textarea) and a Macro to display the custom Html document.
  • James Hayward 17 posts 37 karma points
    Jun 16, 2017 @ 05:23
    James Hayward
    0

    Hi Ben,

    Sounds like the biz.

    Will see if I can get your steps to work.

    Regards J

Please Sign in or register to post replies

Write your reply to:

Draft