Community @ The Turning Gate

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.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2019-03-10 11:04:31

mad
Member
From: Arkansas
Registered: 2014-01-03
Posts: 154
Website

How to access Metadata Category field in php plugin

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

#2 2019-03-10 11:10:25

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: How to access Metadata Category field in php plugin

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

#3 2019-03-10 11:11:45

mad
Member
From: Arkansas
Registered: 2014-01-03
Posts: 154
Website

Re: How to access Metadata Category field in php plugin

There is no example for category. And anything I tried fails.

Offline

#4 2019-03-10 11:13:20

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: How to access Metadata Category field in php plugin

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

#5 2019-03-10 11:14:29

mad
Member
From: Arkansas
Registered: 2014-01-03
Posts: 154
Website

Re: How to access Metadata Category field in php plugin

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

#6 2019-03-12 18:10:27

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: How to access Metadata Category field in php plugin

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

#7 2019-03-19 23:34:31

mad
Member
From: Arkansas
Registered: 2014-01-03
Posts: 154
Website

Re: How to access Metadata Category field in php plugin

Thanks Ben that helps since I am retrieving the Category field for mixed pricing when album_top plugin is called. Appreciate it!!

Offline

Board footer

Powered by FluxBB