Description for all categories and subcategories

Phoca Gallery - image gallery extension
gdX
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 07 May 2010, 20:37

Description for all categories and subcategories

Post by gdX »

How to show description for each category in the list of categories?

[image]
category name
category description
Last edited by gdX on 19 May 2010, 15:22, edited 1 time in total.
gdX
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 07 May 2010, 20:37

Re: Description for each category in the list of categories

Post by gdX »

Yes, it's a decision I have tried.
But it works in the root category.
And how is implemented in the internal categories?
User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 9966
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: Description for each category in the list of categories

Post by Benno »

Hi,
Yes, it's a decision I have tried.
But it works in the root category.
I thought, that was your question. :idea:
Kind regards,
Benno
gdX
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 07 May 2010, 20:37

Re: Description for each category in the list of categories

Post by gdX »

Benno wrote:I thought, that was your question
The objective was to show the descriptions in sub-categories.
User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 9966
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: Description for each category in the list of categories

Post by Benno »

Hi,
The objective was to show the descriptions in sub-categories.
See documentation:https://www.phoca.cz/documents/2-phoca-g ... categories
Fill in the description which appears above the images in the Category View
Kind regards,
Benno
GenkaiNashi
Phoca Enthusiast
Phoca Enthusiast
Posts: 84
Joined: 12 Jul 2009, 22:03

Re: Description for each category in the list of categories

Post by GenkaiNashi »

Hey,

I suggest using a template override for com_phocagallery/views/category/tmpl/default_categories.php -

Add this:

Code: Select all

echo $this->itemscv[$i]->description;
after:

Code: Select all

if ($this->itemscv[$i]->numlinks > 0) {echo '<span class="small">('.$this->itemscv[$i]->numlinks.')</span>';}
If you don't know what a template override is ask here.
gdX
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 07 May 2010, 20:37

Re: Description for each category in the list of categories

Post by gdX »

Hello again!
Thanks for the help, but I can not display the description for all sub-categories.
I'm on the site are three levels of subcategories.
I wish for all levels of output description.

For the root of categories is displayed, but not nested.
Information displays the file com_phocagallery/views/category/tmpl/default.php

This file is a block:

Code: Select all

if ($value->type == 1) {
	if ($value->displayname == 1 || $value->displayname == 2) {
		echo '<div class="phocaname" style="font-size:'.$this->tmpl['fontsizename'].'px"><a href="'.$value->link.'">'.PhocaGalleryText::wordDelete($value->title, $this->tmpl['charlengthname'], '...').'</a></div>';
		echo '<div class="phocaname" style="font-size:'.$this->tmpl['fontsizename'].'px"><a href="'.$value->link.'">'.PhocaGalleryText::wordDelete($value->description, $this->tmpl['charlengthname'], '...').'</a></div>';
	}
}
It displays the category name ($value->title).

I tried to change $value->title for $value->description, but description is not shown.
Strangely, if I write echo $value->title; or echo $value->alias; or echo $value->userfolder; the value shown.
But not a description (echo $ value-> description;)
Why is this happening, if they are in one table?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49144
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Description for all categories and subcategories

Post by Jan »

Hi, check if the description column is loaded from the database (check the whole $value variable)

Jan
If you find Phoca extensions useful, please support the project
stian
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 20 Mar 2013, 13:37

Re: Description for all categories and subcategories

Post by stian »

Hello. I have - I have a problem - I need to take out a description of subcategories. Phocagallery can allow to take out only in the parent category. I tried to change in the file default_categories.php
echo '<p>'. $ this-> itemscv [$ i] -> description. '</ p>'; - and there is no result and
echo $ this-> categories [$ i] -> description; - no result
Suggest please the file (controller?) which describes itemscv and where there is a query to the base for a selection of fields. default does not help. thanks. What the file view.html.php com_phocagallery_v3.2.3\site\views\category\ ??
Last edited by stian on 21 Mar 2013, 07:19, edited 1 time in total.
Post Reply