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.
How do I access the Category Metadata field in album_top plugin. I know how to access Title and Caption However, can someone tell me how to get the metadata for Category.
Here is what I am using to get the title what is the similar coding for Category. I have tried several different options but nothing seems to work any suggestions?
$ph_title = $photo->getMetadata(Photo::$PHOTO_TITLE);
Offline
look in the latest phplugins-pangolin-sample.php file.
you can get it by downloading he latest Backlight-2-Installer zip file.
Unzip it and look in backlight/custom/phplugins.
In the phplugins-pangolin-sample.php file, starting on line 492 are examples that pull image metadata.
maybe try getCategory()
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
one example uses:
$photo->getMetadata(Photo::$PHOTO_TITLE)
you could try
$photo->getMetadata(Photo::$PHOTO_CATEGORY)
otherwise, wait for Ben or Matt to comment.
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Please look at my original post I have that already and it works just fine for Title. I need it for Category!!!! I already tried that with Category BTW and it fails.
Last edited by mad (2019-03-10 11:15:19)
Offline
The Category is only used for mixed pricing and only saved when mixed pricing is enabled in the associated template. In that case it can be retrieved with:
$photo->getMetadata('itemPricing');
Edit:
Another way of getting this would be to set either the Metadata One or Metadata Two field in your album template to {Caption}, republish the photos and then get the value with either:
$photo->getMetadata('metadata_one');
or:
$photo->getMetadata('metadata_two');
That approach would be independent of any cart settings.
Offline