User Tools

Site Tools


using_phplugins_in_backlight_2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

using_phplugins_in_backlight_2 [2018/09/17 21:50] (current)
matthew created
Line 1: Line 1:
 +====== Using PHPlugins in Backlight 2 ======
  
 +...
 +
 +===== Enabling PHPlugins =====
 +
 +To use PHPlugins, duplicate the existing PHP file, ''/​backlight/​custom/​phplugins/​phplugins-pangolin-sample.php''​. Rename the file as you like, keeping the .php extension; for example "​my-phplugins.php"​.
 +
 +In Backlight'​s Designer, edit the desired Page Template. Scroll down and set:
 +
 +  * **Advanced Customization** => **PHPlugins** => **Enabled** : **On**
 +  * **Advanced Customization** => **PHPlugins** => **Include File** : file-name.php
 +
 +Any page, album or album set utilizing that template will run functions from the specified script file.
 +
 +===== the Hook Function =====
 +
 +The basic hook function looks like this:
 +
 +<​code>​
 +
 +function __HOOK__() { 
 + echo '
 +
 + <!-- something echoed -->
 +
 + ';
 + return false;
 +} // END
 +
 +</​code>​
 +
 +===== the Hooks =====
 +
 +View the **phplugins-pangolin-sample.php** file in a text-editor for a complete list of the available hooks. These may be used to replace ''​%%__HOOK__%%''​ in the function above, and correspond to predefined locations in the printed page.
 +
 +The sample file also contains several example functions that you may use as a starting point.
using_phplugins_in_backlight_2.txt ยท Last modified: 2018/09/17 21:50 by matthew