Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Edit code like Google anayltics, typekit and other third party info in one place View modes: 
User avatar
Member
Member
kmaier - 2/12/2014 1:52:41 PM
   
Edit code like Google anayltics, typekit and other third party info in one place
I am new to Kentico and have inherited a site with multiple master templates, my question is, how can i set things up so that i only need to edit third party information like Google, Typekit and etc in one place instead of in every master template?

Thanks for any help!

Kris

User avatar
Member
Member
Armysniper89 - 2/12/2014 3:43:31 PM
   
RE:Edit code like Google anayltics, typekit and other third party info in one place
If it is code that needs to be placed at the end of the body, I typically create it in the layout of my root template of the site. That way it propagates to all other pages in the site.

User avatar
Member
Member
kmaier - 2/12/2014 4:48:33 PM
   
RE:Edit code like Google anayltics, typekit and other third party info in one place
yeah, my problem is that every master template seems to drive every major section within the site.

User avatar
Kentico Consulting
Kentico Consulting
Kentico_RichardS - 2/13/2014 12:49:48 AM
   
RE:Edit code like Google anayltics, typekit and other third party info in one place
Hi,

Thank you for your message.

Well, if there are multiple master pages which are used to several section you cannot edit them in one place. What you can however do is to create e.g. macro which would return the script for these. Now you use this macro in all master pages and now you can manage them all in macro.

Kind regards,
Richard Sustek

User avatar
Member
Member
kmaier - 2/13/2014 5:01:49 PM
   
RE:Edit code like Google anayltics, typekit and other third party info in one place
regarding macros, is this what you are talking about?
http://devnet.kentico.com/docs/5_5/devguide/index.html?appendix_a___macro_expressions.htm

not sure i am following how to implement them.

User avatar
Member
Member
kmaier - 2/13/2014 5:26:19 PM
   
RE:Edit code like Google anayltics, typekit and other third party info in one place
could i include a file of some sort from the Content Management section somehow?

User avatar
Kentico Consulting
Kentico Consulting
Kentico_RichardS - 2/14/2014 1:42:52 AM
   
RE:Edit code like Google anayltics, typekit and other third party info in one place
Hi,

Thank you for your message.

This macro would return javascript (or other) code which you want to maintain on a single place so its sort of an include.

The link you posted is quite old, check out the following guide for macro example : http://devnet.kentico.com/docs/devguide/types_of_macros.htm#custom

Kind regards,
Richard Sustek