I would say that there are different options to achieve that:
You can create a special Document Type which just defines a property for the JavaScript-Code and then create for every Website a single document of this type (in the content section).
You can create a REST-Webservice which creates the JavaScript code (Documentation) and use this webservice from your pages.
And the best way (I think) would be: Create your own MVC-Plugin and use the Controllers to create the JavaScript code automatically (SurfaceControllers) and send the generated code to the corresponding views.
plugin for iframe
We are company that provides online booking for restaurants. A lot of restaurants use Umbraco as their website CMS.
What we provide is some javascript lines for the restaurants to put onto their website. But with Umbraco you can't just add JavaScript into a page.
So we though about perhaps developing a Umbraco plugin or something for the restaurant owners to use.
To make it super easy to add our online booking to their website
Would this be possible and where do we start?
Basically we need to insert the following into the websites page:
<!-- DinnerBooking Booking Box Start -->
<script type="text/javascript" src="http://js.i.dinnerbooking.eu/onlinebooking.js"></script>
<a onclick="return openDBWindow(this.href);" href="http://dinnerbooking.com/" id="wd_booking_btn" title="Book dit bord online" class="btn_blue"><span>Book dit bord online</span></a>
<!-- DinnerBooking Booking Box End -->
Hi Henrik Gemal,
I would say that there are different options to achieve that:
I hope this is what you are looking for.
Best regards, Carl-Philip Wenz
is working on a reply...