Support ⇒ Modules & Blocks ⇒ Adding javascript ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexModules & Blocks

Adding javascript Reply to topic


Facebook are updating their plugins, which will now require their javascript SDK to be included to make them work. Question is, where is the best place to add this script? I've got it working by adding it to the header template but is that the best place? Is there a folder it could be added then automatically picked up to save it being overwritten with any template upgrade?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


I've also had to add Facebook's Open Graph content to the theme's header.html, as Fb in their wisdom Shocked have elected to totally ignore it if placed in the body, even though it is required!

I've just stuck it at the end of the head, ie just before the </head> line.

Interested in hearing any 'official' line, but if there's more than just OG to be added, perhaps I'll add a header-3rdparty.html to reDesign, and then <!-- INCLUDE header-3rdparty.html --> in header.html ...

Or just add a Comment - 3rd party stuff goes here?




[PS. It's a real pain in this v10 having to re-open the OP because you can't see the History when posting as you could on v9, v8, PHP-Nuke, etc. Sad And Preview still ignores <br /> Twisted Evil ]

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


v9 already support hooks files: header_hooks.php and footer_hooks.php.

If you are using a recent v9 then you should already have /header_hooks-example.php and /footer_hooks-example.php.

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.6 / PHP 5.6 / DCVS

Last edited by NanoCaiordo on Sat Jun 06, 2015 11:42 am; edited 1 time in total

All times are UTC


Jump to: