ZenphotoCMS Forum
Display city and country on image.php - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Display city and country on image.php (/thread-11226.html)



Display city and country on image.php - TheBalticFrench - 2013-07-31

Hello

A little post to ask for tips from advanced users.

I am using the defaut template and want a simple page which display in this order:

  • Menu
  • Photo
  • Title
  • City, Country

Beside that I use Adobe Lightroom in which I fill those information (IPTC), I export my photos and upload them on my server.

I have already edited the defaut page to place the title under the photo by moving the following element under the image:

I though it would be easy to do the same for city and country information within the documentation.

I placed the elements "" and ""

But it seems to be a little more complicated. Which file must be modified? And in which way?

Thank you very much from France




Display city and country on image.php - acrylian - 2013-07-31

It is actually the reight way to do. City an Country are standard fields of an image entry. You can check on the backend if there are values.

But those are not the meta data fields you want. You get those using this function:
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetImageMetaData
It returns an array with those data you can then output. The listing of this actually is enabled via a button on all standard themes if there is such data.




Display city and country on image.php - TheBalticFrench - 2013-07-31

I have added the element :

And when I open the page an error occurs:

Parse error: syntax error, unexpected T_STRING, expecting '(' in /homez.150/mylastde/www/gallery/themes/default/image.php on line 80

I still miss something.




Display city and country on image.php - acrylian - 2013-07-31

Of course since that code is really wrong. In short you cannot directly output an array. You have to tell what field and value and then echo it.

Sorry it really exceeds the limits of this forum to teach such things. You should now take the time to learn some PHP basics first before you try to modify a theme.
http://www.w3schools.com/php/default.asp

Also please see here:
http://www.zenphoto.org/news/how-to-read-the-zenphoto-functions-guide




Display city and country on image.php - digitalsafaris - 2013-08-05

This is probably very unsophisticated code, but it works for me (fields are populated in Lightroom before upload):

`

`




Display city and country on image.php - acrylian - 2013-08-05

It's not that bad actually but the outer brackets in (getImageData("country")) are unnecessary.