How to show description for each category in the list of categories?
[image]
category name
category description
Description for all categories and subcategories
-
gdX
- Phoca Newbie

- Posts: 6
- Joined: 07 May 2010, 20:37
Description for all categories and subcategories
Last edited by gdX on 19 May 2010, 15:22, edited 1 time in total.
- Benno
- Phoca Hero

- Posts: 9966
- Joined: 04 Dec 2008, 11:58
- Location: Germany
- Contact:
-
gdX
- Phoca Newbie

- Posts: 6
- Joined: 07 May 2010, 20:37
Re: Description for each category in the list of categories
Yes, it's a decision I have tried.
But it works in the root category.
And how is implemented in the internal categories?
But it works in the root category.
And how is implemented in the internal categories?
- Benno
- Phoca Hero

- Posts: 9966
- Joined: 04 Dec 2008, 11:58
- Location: Germany
- Contact:
Re: Description for each category in the list of categories
Hi,
Kind regards,
Benno
I thought, that was your question.Yes, it's a decision I have tried.
But it works in the root category.
Kind regards,
Benno
-
gdX
- Phoca Newbie

- Posts: 6
- Joined: 07 May 2010, 20:37
Re: Description for each category in the list of categories
The objective was to show the descriptions in sub-categories.Benno wrote:I thought, that was your question
- Benno
- Phoca Hero

- Posts: 9966
- Joined: 04 Dec 2008, 11:58
- Location: Germany
- Contact:
Re: Description for each category in the list of categories
Hi,
Benno
See documentation:https://www.phoca.cz/documents/2-phoca-g ... categoriesThe objective was to show the descriptions in sub-categories.
Kind regards,Fill in the description which appears above the images in the Category View
Benno
-
GenkaiNashi
- Phoca Enthusiast

- Posts: 84
- Joined: 12 Jul 2009, 22:03
Re: Description for each category in the list of categories
Hey,
I suggest using a template override for com_phocagallery/views/category/tmpl/default_categories.php -
Add this:
after:
If you don't know what a template override is ask here.
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;Code: Select all
if ($this->itemscv[$i]->numlinks > 0) {echo '<span class="small">('.$this->itemscv[$i]->numlinks.')</span>';}-
gdX
- Phoca Newbie

- Posts: 6
- Joined: 07 May 2010, 20:37
Re: Description for each category in the list of categories
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:
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?
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>';
}
}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?
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Description for all categories and subcategories
Hi, check if the description column is loaded from the database (check the whole $value variable)
Jan
Jan
If you find Phoca extensions useful, please support the project
-
stian
- Phoca Newbie

- Posts: 5
- Joined: 20 Mar 2013, 13:37
Re: Description for all categories and subcategories
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\ ??
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.