Custom Data: how to print?

Hello!

I was asked to help but I have no clue in the moment:
the zen photo installation is 1.4.2
images have a custom data field
the installation uses the default theme

Now I see that the printout of the custom data of each image is missing, it should sit under the image-description.

I can't find an example how to print out the custom data in the theme.

I know that I must work with a copy of the default theme, that is no problem. Just please help me to print the custom data of each image below the image description in image.php

Cheers, Connie

Comments

  • acrylian Administrator, Developer
    Please see here: http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionprintAlbumCustomData
    http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionprintImageCustomData

    Generally all function names are more or less speaking so you can easily search on the documentation. You can do also everything always via the object model directly.
  • acrylian,

    thank you for the help and hint. But let me tell you that I did a search for printcustomdata and didn't find that.

    As I am not so perfect in object model programming, PHP programming, I think it would be great to have to have a list of "template tags" for the users ;=)

    Cheers, Connie
  • acrylian Administrator, Developer
    We have that on the functions documentation:
    http://www.zenphoto.org/documentation/
    But since that is statically generated from the source you cannot search that via the site search. For that reason we have this article with some quick links:
    http://www.zenphoto.org/news/functions-documentation

    The 2nd link gives you the list of general template functions.

    But there is more and these all use the object model internally which is the base of Zenphoto So the more special things you wish to do the more you need the object model. Believe me it is quite rewarding once you got into that (I am originally coming from design and got to coding by necessity).
  • acrylian,

    I am stuck. Let me start again, because I do not know how to acchieve what we had already and what is gone after an update.

    0) the theme "default" - dark version - was active

    1) all images have a field "Custom Data". There the user adds the price for the image or other info

    2) the content of that field was printed below the image description before

    3) now after that update the content of the field is not printed out anymore. I tried a lot, I just get no result.

    a) I copied the "default theme", as I cannot edit that.
    b) I activated the copy
    c) I cleared the image cache, the browser cache
    d) I edited image.php of that theme

    I do not get any information from the Custom Data Field.

    Please, help me and tell me what I have to add to the template to get the content of the Custom Data Field printed below the image description.

    I worked with ZenPhoto but that is some time ago, now I am quite out of it, but my customer holds me reliable for the changes and I do not know how to help ;=(
  • acrylian Administrator, Developer
    On the theme's image.php use `printImageCustomData()` just like for titles or descriptions. Template functions are context sensitive. So that function will only work on image.php. That's all actually.

    If the site uses the html static cache plugin you need to clear that cache before it is visible to not loggedin visitors.
  • acrylian,
    unfortunately I have no success.

    I added this in the image.php of the active template, I cleared all caches, I cleared the browser cache ...

    "<?php printImageDesc(true); ?>
    <hr />
    <?php printImageCustomData(); ?>
    <?php printImageCustomData(true); ?>"

    both ways (with or without parameter did not work, you can check at
    http://www.galerie-im-wasserturm.de/zen/mensch/CIMG0126.JPG.php

    the custom data of the image has this content: 260€
    but I do not see it and I do not get it

    cheers, Connie
  • acrylian Administrator, Developer
    The parameter does only matter if the frontend plugin is enabled and that shouldn't for security reasons.

    I am sorry I cannot reproduce it. Take a look: http://zenphoto.maltem.de/album1/Cosmos02.jpg.php
  • yes, I see it at your site, but not at mine.
    so what to say? I have no clue.
    I tested with different browsers, empty caches etc.

    would you be so kind and send me the image.php which you used?

    otherwise I do not know what to do.
  • acrylian Administrator, Developer
    It is the plain `image.php` from the current release's default theme with just `printImageCustomData()` added next to the `printImageDesc()` call. Really nothing special done.

    Check the error logs to be sure it is nothing else.
  • I will test, but that is exactly what I have done.
    I will check the error logs

    thanks, Connie
  • acrylian Administrator, Developer
    I noticed the site is 1.4.2. Of course I only tried 1.4.3.1 but I really don't think this has changed for a long time.
  • Just now I found the time to continue on my quest to re-create the information.

    Now it works. My solution?
    I edited image.php and uploaded it after editing.

    Editing it from inside ZENphoto did not work, manual editing and uploading did work.

    Now I keep a copy of the image.php with a link to this thread here to be on the safe side after the next update.

    Thanks for your assistance, Connie
  • acrylian Administrator, Developer
    Thanks for the update. I admit I never really used the built in editor as I find proper editors more convenient. Probably some file permission issue that probably is noted in the server error log.
Sign In or Register to comment.