Getting an API to work in my site

I am desperately trying to get a Platform JavaScript API to work on a page in my site. Can someone please assist me on how to get this to work?

 

Thanks

Quote · 25 Sep 2015

There are a few ways, you can add javascript to the template files.  If it needs to be on one page only, then you can insert a page block with the code, it depends on the code you need to insert, if it needs to be loaded in a certain place.  There are some mods in the market for header injections if you need it on a certain page in the header of the page.

Geeks, making the world a better place
Quote · 25 Sep 2015

Thanks for the response. I have added the PHP block mod, but the java script is not running there. My page stays blank, the actual thing I am trying to insert doesn't appear

 

Any ideas on what header injection mods to look for?

Quote · 25 Sep 2015

PM me the API that you are trying to add so I can better help you.  Once I know the requirements I can better explain to you where to place the code.

Geeks, making the world a better place
Quote · 25 Sep 2015

 

Any ideas on what header injection mods to look for?

 

I've had good results with Deano's head injection module: http://www.boonex.com/m/Head_Injections

 

Check with him if it's compatible with v 7.2 though.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 26 Sep 2015

 

Check with him if it's compatible with v 7.2 though.

 
Unfortunately no. It is not currently compatible with dolphin 7.2.

https://www.deanbassett.com
Quote · 26 Sep 2015

mailed you Geek Girl, thanks

Quote · 26 Sep 2015

Thanks Houston and Deano,

 

Any other ideas on how I can get this to work?

Quote · 26 Sep 2015

 

Any other ideas on how I can get this to work?

 

Dolphin has a built in php function that you can use to load a js file.  The function is used to load files in the inc/js folder, but they can be anywhere you specify.

 

As an example, I  add a folder: inc/js/lytebox then put lytebox.js in that folder

 

Then I put this in a php block on any page I create in page builder (or any page at all for that matter):

 

$GLOBALS['oSysTemplate']->addJs('lytebox/lytebox.js');

 

On the page that this php block exists, and only that page, lytebox.js will be loaded.

If you have multiple js files you want to load at the same time:

 

$GLOBALS['oSysTemplate']->addJs(array('lytebox.js', 'someOther.js'));    //etc

 

There's another convenient built in function to add css files, and it works the same way:

 

$GLOBALS['oSysTemplate']->addCss(array('some.css', 'someMore.css')); // here the css is expected to be in /templates/base/css  or in /templates/tmpl_someTemplate/css

 

These functions will add the js or css appropriately between the head tags

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 26 Sep 2015

Thanks Houston, going to try this!

Quote · 26 Sep 2015
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.