Which variable contains IPTC data and other photo properties?

jl6

Joined: 2007-10-23
Posts: 5
Posted: Thu, 2007-10-25 10:14

Hi,

I would like to make a slight modification to the Matrix theme. I want to replace the item description:

Quote:
<p class="giDescription">
{$theme.item.description|markup}
</p>

with the IPTC caption. This is displayed in the Photo Properties block, but I don't know which variable it is stored in. Does anybody know? And once I know the variable name, how do I make it available to my theme?

Thanks,
James

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22883
Posted: Thu, 2007-10-25 18:42
{if empty($item)} {assign var=item value=$theme.item} {/if}
{* Load up the EXIF data *}
{g->callback type="exif.LoadExifInfo" itemId=$item.id}
{if !empty($block.exif.LoadExifInfo.exifData)}
  {assign var="exif" value=$block.exif.LoadExifInfo}
  {if !empty($exif.exifData)}
    {section name=outer loop=$exif.exifData step=2}
      {section name=inner loop=$exif.exifData start=$smarty.section.outer.index max=2}
      {if ($exif.exifData[inner].title == "IPTC: Caption")}
      {$exif.exifData[inner].value}
      {/if}
      {/section}
    {/section}
  {/if}
{/if}

That will display the 'IPTC: Caption" you will have to change it to display the caption if it is named something else.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
jl6

Joined: 2007-10-23
Posts: 5
Posted: Sat, 2007-10-27 14:21

When I put that code into my photo.tpl file, the callback doesn't seem to do anything - $block.exif.LoadExifInfo.exifData is empty. Why is that checked twice? Any ideas what is going wrong?

Thanks,
James

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22883
Posted: Sat, 2007-10-27 22:24

Edited the code above and tested on the matrix theme photo.tpl

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
jl6

Joined: 2007-10-23
Posts: 5
Posted: Mon, 2007-10-29 13:16

Thanks, that works perfectly.

 
amarks
amarks's picture

Joined: 2006-12-14
Posts: 42
Posted: Thu, 2008-01-10 01:35

Can I paste this code in the photo.tpl page under the Large Photo? If not how can I?

- Humility and Knowledge Create Wisdom -

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22883
Posted: Thu, 2008-01-10 02:34

Yes you can paste that on photo.tpl
but if you want it under the photo .... You can use the EXIF module and pick the items you want to show. Edit album theme tab "Blocks to show on photo pages" add the EXIF info See:
http://langleycom.com/gallery2/v/jet.JPEG.html

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
amarks
amarks's picture

Joined: 2006-12-14
Posts: 42
Posted: Thu, 2008-01-10 04:56

I have edited the album theme tab and it looks great but when I add another block item it adds more blocks either above or below. I need the Album MenuTree next to the thumbnails and the EXIF under the Photo. With the Album MenuTree and the EXIF being in the same blocks I cant figure out how to separate the two as two different elements (blocks) to put elsewhere on the page. Any ideas?

Adam

- Humility and Knowledge Create Wisdom -

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22883
Posted: Thu, 2008-01-10 05:25

Sounds to me like you want to move the Album select block ......You mention thumbs on the photo page so perhaps you can start an new thread with a URL or screen shot ( I don't know what theme you are using) so I can understand a bit more of what you are after.
If you want to move the dtree then start a new thread.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
amarks
amarks's picture

Joined: 2006-12-14
Posts: 42
Posted: Thu, 2008-01-10 07:27

I guess what Im asking is how do I create custom blocks for the EXIF photo info. Im using G2 2.2.2 Full.

- Humility and Knowledge Create Wisdom -

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22883
Posted: Thu, 2008-01-10 14:49

If you go to site admin, [Extra Data] EXIF IPTC, there you will be able to customize the information for showing what data you want to show on the block.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
amarks
amarks's picture

Joined: 2006-12-14
Posts: 42
Posted: Sun, 2008-01-13 01:52

I Thanks FloriDave for the IPTC code. I out divs around and it works great. Can I add the copyright next to the IPTC too. If so whats that code snippet?

Thanks,
Adam

- Humility and Knowledge Create Wisdom -

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22883
Posted: Sun, 2008-01-13 04:08

I don't understand why you can use the block? it is a lot easier than adding a bunch of code.

      {if ($exif.exifData[inner].title == "copyright")}
      {$exif.exifData[inner].value}
      {/if}

but you will have to find the right title as copyright is probably not it.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
amarks
amarks's picture

Joined: 2006-12-14
Posts: 42
Posted: Sun, 2008-01-13 04:13

Do I put divs around it to enclose it.

- Humility and Knowledge Create Wisdom -

 
amarks
amarks's picture

Joined: 2006-12-14
Posts: 42
Posted: Sun, 2008-01-13 04:14

Thanks...

- Humility and Knowledge Create Wisdom -

 
amarks
amarks's picture

Joined: 2006-12-14
Posts: 42
Posted: Mon, 2008-01-14 00:30

Where do I look for the blocks coding like the one from IPTC and COPYRIGHT?

- Humility and Knowledge Create Wisdom -

 
amarks
amarks's picture

Joined: 2006-12-14
Posts: 42
Posted: Mon, 2008-01-14 00:41
Quote:
but you will have to find the right title as copyright is probably not it.

When you say title, were would I see which title I have or use?

Luminouslands.com

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22883
Posted: Mon, 2008-01-14 04:40
Quote:
Where do I look for the blocks coding like the one from IPTC and COPYRIGHT?

I don't understand.

Quote:
When you say title, were would I see which title I have or use?

enable the EXIF module. Configure it to show all items you want to show. Add the exif block to a photo page. There you will see the title of the EXIF info and the detail of that title.
If you look at the attachment the title is in the left column and the data is in the right. The attached does not have the COPYRIGHT field so it does not show.
So you will have to find a image that does have the info and use the proper spelling of the title.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

AttachmentSize
EXIF_SHOT.jpg87.33 KB