ZenphotoCMS Forum
how to use? - 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: how to use? (/thread-12267.html)



how to use? - ventesites - 2015-08-16

Hello
I am news to this program, this is really the best gallery software i used.
I just do not understand how to use related_items.
I activated the plugin but how does it work?

I would like to be able to display images in my news pages when the name of this image is mentionned, can it be done wit this extension and how?
Thanks

Pat




how to use? - acrylian - 2015-08-16

Documentation of the plugin is found here:
http://www.zenphoto.org/documentation/plugins/_zp-extensions---related_items.php.html

You have to modify your theme and place the function printRelatedItems() where you want the related items to show. Set the parameters as you need them. As described the plugin prints a list of related items based on the tags assigned to them and the current item.

Quote:I would like to be able to display images in my news pages when the name of this image is mentionned, can it be done wit this extension and how?
No.




how to use? - ventesites - 2015-08-16

But how is defined the relationship? beetween what and what?




how to use? - acrylian - 2015-08-16

Quote:As described the plugin prints a list of related items based on the tags assigned to them and the current item.




how to use? - ventesites - 2015-08-16

Ok, i still don't get it.... let say i have an image with tag "sunshine" and a news article with same tag.

I see on my news page tags: sunshine

when i click on it brings me to the search page with the picture BUT i would much prefer to have pictures displayed on my news page as thumbnails

On the news page I have :

I tried to replace 'news' by 'images' and it does nothing....

In fact i still don't have any idea what this code is supposed to do... Is there a working example somewhere?

Thanks

Pat




how to use? - acrylian - 2015-08-16

You have not paid attention to the the parameters:
printRelatedItems( 5, 'images', null, null, true, false ); would give you thumbs of images. Take a look here maybe: http://www.zenphoto.org/news/how-to-read-the-zenphoto-functions-guide

The function interally uses a search to get the items. So search must have "tags" and images results enabled. (Options > Search)

A working example although a bit customized you see on our site below every article.




how to use? - ventesites - 2015-08-16

Using the code you provide nothing happens, when i look under options->search, there is a menu with boxes to check, mine are :

Description, tags, title

but i see nothing coming close to "images results enabled"....




how to use? - ventesites - 2015-08-16

BTW I use zpbase template and I can't find the function "printRelatedItems" in functions.php, should be there, no?




how to use? - acrylian - 2015-08-16

On Options > Search right below the checkboxes you noted there are some radioboxes followed by four checkboxes "Do not return XXX matches". The one for images should not be checked, otherwise you will not get any results on related items.

Quote:BTW I use zpbase template and I can't find the function "printRelatedItems" in functions.php, should be there, no?
Of course not, it is a function of the related_items plugin.




how to use? - ventesites - 2015-08-16

None of the 4 options are checked....




how to use? - acrylian - 2015-08-16

Check if your images are published and that you put the function call in the right file. Please see the theming tutorial for the basics: http://www.zenphoto.org/news/theming-tutorial




how to use? - ventesites - 2015-08-16

I am using zpbase and i didn't add or remove the code, it was there on news.php

do you think i should had something to the file news.php located in the Zenpage folder?




how to use? - ventesites - 2015-08-16

Is it normal behavior that the search page opens when i click on a tag link in the news.php?




how to use? - acrylian - 2015-08-16

Sorry, zpBase is not an official theme so I am not familiar with it.

Yes, clicking on a tag link will get search results.




how to use? - Ralf - 2015-08-22

Hi,
as far as i know it is just normal that the search pages opens.
But it should not be opened empty.

If you click on a tag that is named for example *animals' the search page should open and show all results containing the tag 'animals'.

Cheers
Ralf