Page 1 of 1

How to set a specific image of a category?

Posted: 23 Feb 2010, 16:42
by Amrit
Hi Jan. I like Phoca, but sometimes I'm sort of bewildered with all options.

When I create a Category, I can set the image of that category in the settings.
I can also choose left or right alignment.

But in the parameters I can only choose to use an image in the folder of the displayed category, or use folder icon, and I seem to set it with the setting :Display image instead of folder icon.

I tried using Special, but since I haven't found what it actually does I see no use of it.

I found where to change the code in phoca so I can do what I want, components/com_phocagallery/views/category/tmpl/default_categories.php from line 25-100.
I just don't know how to get the images I have set in the category whn I created it.

I will try however, some more, to see if I manage to get the images.

Hope someone can help

Cheers

Amrit

Re: How to set a specific image of a category?

Posted: 26 Feb 2010, 14:13
by Jan
Hi, special means that no recursive function will be used and the first image will be taken (depends on category ordering - if category is ordered e.g. by ordering ASC, then first image will be taken) ... the best way is order some image to first position and set e.g. order by ordering ASC, so then the first image will be displayed.

Jan

Re: How to set a specific image of a category?

Posted: 27 Feb 2010, 14:05
by Amrit
Hi Jan.

Thanks for your time and for your answer.

The thing is that I need and icon to represent the content of each category, and to put an icon togheter with photos will just not look good.
I know I can set the image of each category, and when I view that category, I can see that image in the top of the category view listing. (If correctly set in params)

And since the code for viewing the chosen categoryimage of each category is already present, perhaps it only takes a little snippet of code to fetch the image of each category in categories view, rather then fetching an image in a category?

I think the code for viewing the image assigned to each category is in the file views/category/tmpl/default.php, row 24-27, and the code for viewing the image of each category when in categories I'm not really shure where it is, guess it depends wheter or not I have table, float or UL set in params.

Re: How to set a specific image of a category?

Posted: 27 Feb 2010, 15:38
by Jan
Hi, then this must be customized in the code :( but for now I don't know what exactly needs to be modified :-(

Re: How to set a specific image of a category?

Posted: 28 Feb 2010, 17:29
by Amrit
Yes, I guess it needs to be customized.

I figure a selection could possibly be added to the select list of "Display image instead of folder icon" called something like Use image of category.
Then add the neccesary code for that selection. (And I guess this might be in the feature)

It seems to me most of the code actually already exist since the image choosen for a category can be retrieved when being inside a category. I tried to use that snippet of code from category/tmpl/default.php (row 24-27) inside categories/tmpl/default.php, but I haven't gotten so far to know exactly were to insert the code.

I'm not a coder like you are, so it takes me some time to really understand what I am looking at when I read all the files of Phoca. But if I solve it I will let you know.

Have a nice day

Amrit