ZenphotoCMS Forum
Error with tag cloud. - 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: Error with tag cloud. (/thread-11871.html)



Error with tag cloud. - lainyrache - 10-07-2014

Hi
Can anyone help? I am using Zenphoto version 1.4.6 & php 5.4

I would like to have a tag cloud that displays all tags on the site, whether they be on a page, news, image or album.
So that an album can use the same tag as a news item.
Is this possible ?

I am using the plugin tag_extras
I have tried
`

and

I am getting the following errors.

Warning: Invalid argument supplied for foreach() in /home/ch/public_html/dev/zp-core/zp-extensions/tag_extras.php on line 290

Warning: array_unique() expects parameter 1 to be array, null given in /home/chalkwor/public_html/dev/zp-core/zp-extensions/tag_extras.php on line 292

Warning: Invalid argument supplied for foreach() in /home/ch/public_html/dev/zp-core/zp-extensions/tag_extras.php on line 293

`
Any ideas on what I am doing wrong or is this a bug?




Error with tag cloud. - acrylian - 10-07-2014

No bug, you are using it wrong ;-) printAllTags() requries an array of the tags to display as generated by the getAllTagsFromXXX functions (as written on the documentation). It is the base function for the printAllTagsFromXXX functions.
getAllTagsFromAlbum_multi_unique() is not meant to be used standalone at all.

This plugin is meant to get only the tags from Zenpage news or pages or a specific album plus optionally its subalbums

If you want all tags as a cloud regardless from where use this one: http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionprintAllTagsAs

That function is also the example on how to read the user guide:
http://www.zenphoto.org/news/how-to-read-the-zenphoto-functions-guide




Error with tag cloud. - lainyrache - 10-07-2014

Thanks Acrylian.
I now have a list with

This prints a list rather than a cloud but that may be something to do with my theme. I am sure I can work it out.
thanks for your help
e




Error with tag cloud. - acrylian - 10-07-2014

Yes, it does print a list but the function does not have default css so the theme has to control it. You can look at the standard themes' css. But you should see different sized tag names depending on the number of usage as those are added inline.




Error with tag cloud. - MarkRH - 12-07-2014

Yeah, I just got through playing around with the tag cloud on my gallery that I'm working on yesterday or the day before. In the Garland theme that mine is based on, I noticed that it had a "tags" CSS class. So, in that function call, I would use "tags" as the second parameter:
printAllTagsAs('cloud' , 'tags', NULL, FALSE, TRUE, 2, 25, 2, NULL, 0.8);

I modified the CSS of the class to make it look more like what my current Gallery 3 tag cloud is doing.