Support community for TTG plugins and products.
NOTICE
The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.
This forum is now closed, and exists here as a read-only archive.
You are not logged in.
I cannot find the thread in which this was originally asked about, but here's some stuff you can do in Backlight 2, using the new PHPlugins functionality, to create a custom image loop.
/* DELETE THIS LINE
// Create a custom image loop for albums
function album_top()
{
if ($this->hasAlbum()) {
$photos = $this->album->getPhotosForPage();
foreach ( $photos as $photo ) {
$th_path = $photo->getURL('thumbnails'); // thumbnail src
$th_h = $photo->getThumbnailHeight(); // thumbnail height
$th_w = $photo->getThumbnailWidth(); // thumbnail width
$ph_path = $photo->getUrl('photos'); // photo src
$ph_h = $photo->getPhotoHeight(); // photo height
$ph_w = $photo->getPhotoWidth(); // photo width
$ph_id = $photo->getItemNumber(); // photo number
$ph_page = $photo->getSingleURL(); // link to photo page
$orientation = $th_w === $th_h ? 'square' : ( $th_w > $th_h ? 'landscape' : 'portrait' );
$img_alt = $photo->getFilename();
$img_caption = $photo->hasMetadata(Photo::$PHOTO_CAPTION) ? $photo->getMetadata(Photo::$PHOTO_CAPTION) : '';
$img_title = $photo->hasMetadata(Photo::$PHOTO_TITLE) ? $photo->getMetadata(Photo::$PHOTO_TITLE) : $photo->getFilename();
echo '<p style="margin-bottom: 1.5rem">';
echo '<img src="'. $th_path .'" alt="'. $img_caption .'" /><br />';
echo $photo->getFilename();
echo '</p>';
}
}
return false;
} // END /**/
Offline
That question was probably from me, and was something I added on to a somewhat unrelated topic (bad me).
Is there some code I can look at lists all the data/function calls that are accessible? Examples are great, but I'm an old mainframe guy who was accustomed to volumes and volumes of documentation that listed everything. I don't mind hunting through the code to figure it out, but I have no idea where to start looking.
Thanks!
Offline