Page 1 of 3

Categories with custom select possible

Posted: 04 Feb 2017, 17:45
by marcel77
Hi all,

I think, generating of categories is based on database queries?

Is it possible to generate "virtual" categories by "giving" a database query or result to a script and I get a categorie overview like a regular category?

This could be the solution for my problem of individual filtering.

Marcel

Re: Categories with custom select possible

Posted: 05 Feb 2017, 19:31
by Jan
Hi, sorry, I don't understand what do you exactly mean?

Jan

Re: Categories with custom select possible

Posted: 05 Feb 2017, 22:03
by marcel77
Hi Jan,

I think you use database queries to select the pictures for each categories, or?

Is it possible to give a custom database query (select id from phoca_gallery where ...) to your module with, for example, post method und get the known phoca gallery sigth for custom selected pictures?

Where you generate the caegory view?

oder auf deutsch:

Ich denke, du benutzt Datenbankabfragen, um die Bilder für jede Kategorie auszuwählen, oder?

Kann ich an irgeneiner Stelle eigene Datenbankabfragen per z.B. Post-Methode an Dein Modul übergeben, und dann für individuel selektierte Bilder die gewohnte Phoca Gallery Ansicht bekommen?

Wo wird die Kategorieansicht erstellt?

Marcel

Re: Categories with custom select possible

Posted: 08 Feb 2017, 17:21
by Jan
Hi, yes, if you are located in category view, it has some ID, e.g. ID = 1, then the sql query asks for all images (including pagination) which belong to category 1

components\com_phocagallery\models\category.php

So, I would change the query in this file if needed :idea:

Jan

Re: Categories with custom select possible

Posted: 16 Feb 2017, 12:35
by marcel77
Hi Jan,

Thanks a lot! I took a look on this file. I´m wondering about finding TAG selection within the where-clause. Is it possible to use it yet? At the moment this ist one thing I´m searching for.

I will give a possibility to show all pictures of a category or only pictures with a selectable TAG. Maybe with a combo box on every site to select the TAG.

It may be perfect, if I find a way to show all pictures from one category and all subcatoegories depending a special TAG. in an extra step

Marcel

Re: Categories with custom select possible

Posted: 16 Feb 2017, 19:52
by Jan
Hi, yes, you can somehow include (left join) the tag table so then you can apply the query over the tags too :idea:

Jan

Re: Categories with custom select possible

Posted: 16 Feb 2017, 20:46
by marcel77
Oh sorry, I mean use directly in front end? Without changing Sourcecode.

Marcel

Re: Categories with custom select possible

Posted: 19 Feb 2017, 16:59
by marcel77
Hi Jan,

sory, I´m not php and joomla enough to understand all the things.

I found the ready sourcecode in category.php for querries with tag selection, but I don´t found, how to use? I try to add post "?tag=1" or "?tag=landscape" to the url for a category, but nothing happend. So I think, implementation is not ready yet.

Marcel

Re: Categories with custom select possible

Posted: 19 Feb 2017, 19:42
by Jan
Hi, the parameter is "tagid" and it accepts integer (or integer + alias)

e.g. tagid=1-alias

Jan

Re: Categories with custom select possible

Posted: 19 Feb 2017, 21:55
by marcel77
Hi Jan,

it´s amazing, it works :D Thanks a lot!!!

May you tell me something more about tag filtering? Do you have something like a public variable, so that the "tag filter" stays after changing the category? And ist it possible to filter all pictures, which haveing 2 selected tags

With the post method, I have to set the filter after every side switch.

Marcel