You are here

public function JuiceboxGalleryDrupalInterface::buildEmbed in Juicebox HTML5 Responsive Image Galleries 7.2

Build a render array of the embed code for a Juicebox gallery after images and options have been added.

Note that this is different from JuiceboxGalleryInterface:renderEmbed() in that it handles ALL considerations for embedding. This includes the addition of the appropriate js and css which would otherwise need to be done independent of renderEmbed(). It also uses the Drupal theme system as opposed to just returning direct markup. Within Drupal this method should always be used instead of renderEmbed().

Parameters

string $xml_path: The path to the Juicebox XML for this gallery.

boolean $add_js: Whether-or-not to add the Juicebox library and gallery-specific javascript.

array $context: Optional contextual information that may be used in the display:

  • conf_path: A Drupal path within the admin interface where the gallery can be configured. This may be used within administrative contextual links for the gallery if provided.

boolean $add_xml: It may be difficult or impossible to rebuild some types of formatters during a separate XML request, so this option offers a way around that by embedding the XML for the gallery directly into the HTML output. This XML can then be fetched from a request to this same page later via a sub-request. If TRUE xml-source-path and xml-source-id query strings are also added to the XML URL to help the XML building logic locate this XML data later. Setting this option may work around certain limitations but will likely lead to slower XML generation.

Return value

array Drupal render array for the embed code that describes a gallery.

1 method overrides JuiceboxGalleryDrupalInterface::buildEmbed()
JuiceboxGalleryDrupal::buildEmbed in includes/JuiceboxGalleryDrupal.inc
Build a render array of the embed code for a Juicebox gallery after images and options have been added.

File

includes/JuiceboxGalleryDrupalInterface.inc, line 128
Interface definition for a Juicebox gallery that includes Drupal functionality.

Class

JuiceboxGalleryDrupalInterface
Interface definition for a Juicebox gallery that includes Drupal functionality.

Code

public function buildEmbed($xml_path = '', $add_js = TRUE, $context = array(), $add_xml = FALSE);