How to display only one category in an article...

Phoca Gallery - image gallery extension
Karmageddon
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 06 Jun 2011, 02:33

How to display only one category in an article...

Post by Karmageddon »

... this question is answered very simple.
Just hide the categories you do not want to be shown as a gallery in your article. (It is very easy as I am using the Gallery Plugin & Gallery Button Plugin)

But when I add more and more new categories, add pictures to those categories, those new categories will be shown in every existing article (in addition to the existing category/gallery) where I added one single category and excluded all the others before. So I have to edit every single article again (excluding the new category so that this new gallery is not shown in the article). Right? Or is there another way to specify that I only want to show only THIS category in THAT article.

Actually I have got >30 articles. Every article has got ONE specified category gallery. But I will be adding several categories every month and every category is only displayed in one specified article.

Hope you know what I mean and that you can help me. Love the components you make!
(If you do not understand my english, just let me know, I can translate it to German (my motherlanguage) too :-) )

Kind regards
Karmageddon
Karmageddon
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 06 Jun 2011, 02:33

Re: How to display only one category in an article...

Post by Karmageddon »

Ah ok I figured it out:
You have to edit the code that is added by the Gallery Button Plugin a bit.

Instead of excluding many categories like that:

Code: Select all

{phocagallery view=categories|imagecategories=1|imagecategoriessize=5|hidecategories=2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36}
I now write:

Code: Select all

{phocagallery view=categories|imagecategories=1|imagecategoriessize=5|categoryid=37}
Would it be possible to implement this funktion to the Gallery Button Plugin? That would be very very handy. :D

Kind regards
Karmageddon
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49144
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: How to display only one category in an article...

Post by Jan »

Hi, this is in feature request list.

Jan
If you find Phoca extensions useful, please support the project
edox677
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 30 Mar 2016, 21:42

Re: How to display only one category in an article...

Post by edox677 »

Hi

I tried to display only one category in a single article. How can I select only one category instead of hiding other categories.
The mentioned code above didn't work at my joomla.

Can you help me please??
Thanks
User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 9965
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: How to display only one category in an article...

Post by Benno »

Hi,
see documentation: https://www.phoca.cz/documents/14-phoca- ... ery-plugin
Add the following code into the article:
Categories displaying

phocagallery - display Phoca Gallery Plugin
view - categories | category | switchimage - display all categories, some image from category or the switch image
categoryid - number - ID of category which you want to display, in case of only 1 category[...]
Kind regards,
Benno
edox677
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 30 Mar 2016, 21:42

Re: How to display only one category in an article...

Post by edox677 »

Hi Benno

so what I did was this:

Code: Select all

{phocagallery view=category|imagecategories=1|imagecategoriessize=1|categoryid=1}
instead of using

Code: Select all

{phocagallery view=categories|imagecategories=1|imagecategoriessize=1|hidecategories=2,3,4,5,6,7,8}
only the last code line would work! Where is the error?
User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 9965
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: How to display only one category in an article...

Post by Benno »

Hi,
Categories View (example code):

Code: Select all

{phocagallery view=categories|categoryid=1|imagecategories=1|imagecategoriessize=5}
Category View (example code):

Code: Select all

{phocagallery view=category|categoryid=1|limitstart=0|limitcount=0}
Result in frontend:
Image

Kind regards,
Benno
edox677
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 30 Mar 2016, 21:42

Re: How to display only one category in an article...

Post by edox677 »

Thx, now it works.
I had another bug too. I also refered to a category that didn't include any pictures.
User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 9965
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: How to display only one category in an article...

Post by Benno »

You're welcome!

Kind regards,
Benno
Post Reply