User Tools

Site Tools


using_phplugins_in_backlight_2

Using PHPlugins in Backlight 2

PHPlugins enable designers to effect changes to their Backlight website globally, locally or specific to a single page, and to maintain those changes from a single, persistent location. Using PHPlugins, user customizations may be applied to pages with precise control and in a dynamic, automated fashion.

The possibilities are limited only by your ingenuity — use PHPlugins to keep up with your constantly changing social networks; site-wide navigation menus may be managed and updated from a single source; custom header, menu and footer designs may be applied dynamically to all pages in your site, and widgets may be added to specific pages.

With Great Power Comes Great Responsibility

Be forewarned, however, that PHPlugins should be filed under Advanced Features. The feature is intended for use by web-designers, and assumes prerequisite knowledge of HTML and CSS, familiarity using an FTP client and text-editor to access and manipulate files on a web-server, and some degree of comfort working with PHP script.

If the last paragraph makes you queasy feeling, then PHPlugins are not for you. There are limits to the amount of support we can provide on these features if you do not have the necessary background to make sense of them.

That said, our documentation and the provided examples should allow most users to make sense of things without too much trouble.

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 CustomizationPHPluginsEnabled : On
  • Advanced CustomizationPHPluginsInclude 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:

function __HOOK__() { 
	echo '
	
	<!-- something echoed -->

	';
	return false;
} // END

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: 2019/03/31 02:07 by matthew