User Tools

Site Tools


using_phplugins

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
using_phplugins [2014/07/09 05:20]
matthew [Publisher Hooks]
using_phplugins [2014/07/09 05:27] (current)
matthew [Hooks for CE4 Publisher Albums and Album Sets]
Line 349: Line 349:
 ---- ----
  
-===== Hooks for CE4 Publisher Albums and Album Sets =====+===== Targeting ​CE4 Publisher Albums and Album Sets =====
  
 In CE4, you may target albums and album sets by slug or by template name. In CE4, you may target albums and album sets by slug or by template name.
 +
 +Targeting an album by slug is the publisher equivalent to targeting non-publisher galleries by location. We can modify the example function from above to use the G_SLUG target:
 +
 +<​code>​
 +function ttg_header_navigation( $style, $path ) {
 + if (G_SLUG == '​album-slug'​) {
 + echo '
 +
 + <!-- navigation HTML here -->
 +
 + ';
 + return false; // Replaces normal menu for the specified album
 + }
 + return true; // Pages not this album use normal menu
 +} // END
 +</​code>​
 +
 +The value for G_SLUG is case sensitive, and should match exactly the slug used in the Album Setup.
 +
 +----
 +
 +Alternatively,​ you may which to target all albums or album sets using a specific template. For this, we use G_TEMPLATE:
 +
 +<​code>​
 +function ttg_header_navigation( $style, $path ) {
 + if (G_TEMPLATE == '​template-name'​) {
 + echo '
 +
 + <!-- navigation HTML here -->
 +
 + ';
 + return false; // Replaces normal menu for the specified album
 + }
 + return true; // Pages not this album use normal menu
 +} // END
 +</​code>​
 +
 +Again, the value of G_TEMPLATE is case sensitive and should match exactly the name of the template selected during Album Setup.
 +
 +----
 +
  
  
using_phplugins.txt ยท Last modified: 2014/07/09 05:27 by matthew

The Turning Gate
Creating webbly, wobbly, Lightroomy things since 2007.