Sometimes looking at the documentation really helps:
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionprintTags
There is nearly always a get/print pair of functions.
Do you know what an array is? If not I suggest to learn the php basics. To print an array you need to loop through it. For a one dimensional array like this one: http://www.php.net/manual/en/control-structures.foreach.php
Infos on array: http://php.net/manual/de/language.types.array.php
I know what an array is, but don't really know how to use it.
I read the instructions on printTags, but it somehow illudes me.
On a page with thumbs I would like the list of tags to appear (tags associated with images inside that album) In album.php I have this:
$listoftags = getTags(); printTags('links',NULL,'taglist',', ',TRUE,'',true); printTags($listoftags);
but both the second and third line result in 'no tags' message, while some of the images inside this album do have tags.
You should really read the doc carefully. printTags() prints the tags of the current album or image. It depends in which context you use it. I admit that not directly written there. But take a look how the standard themes use that function.
You can't pass an array (the doc does not tell you that at all...). So on album.php or within the next_album loop it will print the album tagsg and on image.php or within the next_image loop it will print the image tags. (it will also print tags for Zenpage pages or news articles btw if used in that context).
So you only need your 2nd line but in the right context.
So if I understand you correctly, what I want is not possible, because I want the tags of all the seperate images within an album displayed on the page with the thumbs (within album.php). That would make sense to me because then, inside an album with the title 'mammals' I could quickly jump to 'dogs' or 'german' or 'sheppard'.
It would be nice if this was possible in the future.
Thanks for your information though .
I probably do not understand. So do you want to display all tags of all images within that album or the tags for each image in that album? The last is possible if you use the function within the next_image loop.
The first is possible too but requires custom coding. I have something like that on my list though but it's not the only one..;-)
Uh... sorry, but are the two options you mentioned not exactly the same???
After reading your reply again I think what I want is option 1 and not option 2 as I mentioned in my previous reply.
So: all tags for all images inside that album in one list beneath or aside from the thumbs.
Hello Acrylian,
I just tried the plugin, but somehow I'm not getting any results.
First I tried this:
printAllTagsFromAlbum("",false,'images','',"",false,1,1,1,50)
as I expected the function to automatically return the tags from the images within the current album. But with this I get:
`
[*]
`
No link, no text.
Then I tried
printAllTagsFromAlbum("cows",false,'images','',"",false,1,1,1,50)
but with the same result. Perhaps I'm doing something wrong. It would be nice if the function could return a taglist of a specified album > images, but in general I think it should return the tags from the current album > images.
But like I said, perhaps I'm not using the function correctly.
EDIT: I placed the function in album.php...
The first does not work, this function requires an album to be set.
Is "cows" a subalbum? Subalbum names are not the direct folder name but the path including parentlevels: toplevelalbum/sublevelalbum/.... The easiest to get the right name is to use $_zp_current_album->name if you are in album context. Otherwise you need to remember that manually.
Are you really sure that the images in that album have tags and that you are in album context??? Are there really direct images in that album you are trying? If not the 2nd parameter needs to be "true". Or any errors in the server log maybe?
(I have of course tried it and it did work...)