How to add a description in the main (parent) category?
-
Alexander_photo
- Phoca Member

- Posts: 18
- Joined: 23 Feb 2010, 14:07
- Contact:
How to add a description in the main (parent) category?
I use the menu "Phoca Gallery All categories"
How do I add on top of the list of all categories - a description?
How do I add on top of the list of all categories - a description?
- Jan
- Phoca Hero

- Posts: 49172
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: How to add a description in the main (parent) category?
Hi, there is no such option, so this needs to be customized in template of categories view or this can be solved through some module.
Jan
Jan
If you find Phoca extensions useful, please support the project
-
Alexander_photo
- Phoca Member

- Posts: 18
- Joined: 23 Feb 2010, 14:07
- Contact:
Re: How to add a description in the main (parent) category?
Thank you for your reply!Jan wrote:Hi, there is no such option, so this needs to be customized in template of categories view or this can be solved through some module.
Jan
Please add this option in the next version of the gallery!
- Jan
- Phoca Hero

- Posts: 49172
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: How to add a description in the main (parent) category?
Added into feature request list.
Jan
Jan
If you find Phoca extensions useful, please support the project
-
Alexander_photo
- Phoca Member

- Posts: 18
- Joined: 23 Feb 2010, 14:07
- Contact:
Re: How to add a description in the main (parent) category?
Thank!!!Jan wrote:Added into feature request list.
Jan
-
carriepr1
- Phoca Newbie

- Posts: 8
- Joined: 18 Feb 2009, 02:11
Re: How to add a description in the main (parent) category?
I would like this too. I want to have a description on the main photo gallery page that is linked to the main menu. I believe that would be the categories view. It seems like most people would want this, so I hope this can get added soon.
In the meantime, can you tell us what code to add for this, and to which file?
In the meantime, can you tell us what code to add for this, and to which file?
-
imperialWicket
- Phoca Enthusiast

- Posts: 78
- Joined: 28 Feb 2010, 15:39
Re: How to add a description in the main (parent) category?
This will be a handy update. In the meantime, if anyone needs this functionality you can hard-code a value in the "// Pagetitle" section of the /components/com_phocagallery/views/categories/tmpl/default.php file.
Something like the following would work:
The page_title value check probably is not necessary, but it gives you the opportunity to have multiple menu items that may or may not include the description. You will need to choose an appropriate div class or customize some CSS if the contentdescription styling is not optimal for your page.
Hope this helps.
Something like the following would work:
Code: Select all
// Pagetitle
if ( $this->params->def( 'show_page_title', 1 ) ) {
echo '<div class="componentheading'.$this->params->get( 'pageclass_sfx' ).'">'. $this->params->get('page_title').'</div>';
}
// DESCRIPTION UPDATE BEGIN
if ($this->params->get('page_title')=='MENU ITEM'){
echo '<div class="contentdescription">My description for the parent category</div>';
}
// DESCRIPTION UPDATE ENDHope this helps.
-
Alexander_photo
- Phoca Member

- Posts: 18
- Joined: 23 Feb 2010, 14:07
- Contact:
Re: How to add a description in the main (parent) category?
imperialWicket
Please show me an example of all the modified files to add a description in the parent category
What about multilingual sites? I need to show two different descriptions, depending on the choice of language.
Please show me an example of all the modified files to add a description in the parent category
What about multilingual sites? I need to show two different descriptions, depending on the choice of language.
-
imperialWicket
- Phoca Enthusiast

- Posts: 78
- Joined: 28 Feb 2010, 15:39
Re: How to add a description in the main (parent) category?
This post is not a proper improvement or feature update, rather it is a hack to manually put a hardcoded text string onto the Category page below the title.
The only necessary modification to any files is to add the three lines of code listed above directly beneath the page_title echo.
However, you highlight a good update, alternate languages should always be supported when practical, and in order to do so, the following changes are needed:
Instead of hardcoding the text string in the /components/com_phocagallery/views/categories/tmpl/default.php file, use a String reference value that we can add to your Phoca Gallery language files:
Now, at the bottom of the language file (add to each language you support) /language/en-GB/en-GB.com_phocagallery.ini add:
This requires the update to the mentioned default.php tmpl file, telling the template to display your value, and then you must add the value to each language file that will be available.
I haven't encountered the need to support multilingual Phoca Gallery installations, but I believe this will work. Good luck.
The only necessary modification to any files is to add the three lines of code listed above directly beneath the page_title echo.
However, you highlight a good update, alternate languages should always be supported when practical, and in order to do so, the following changes are needed:
Instead of hardcoding the text string in the /components/com_phocagallery/views/categories/tmpl/default.php file, use a String reference value that we can add to your Phoca Gallery language files:
Code: Select all
// Pagetitle
if ( $this->params->def( 'show_page_title', 1 ) ) {
echo '<div class="componentheading'.$this->params->get( 'pageclass_sfx' ).'">'. $this->params->get('page_title').'</div>';
}
// DESCRIPTION UPDATE BEGIN
if ($this->params->get('page_title')=='MENU ITEM'){
echo '<div class="contentdescription">'.JText::_('PHOCAGALLERY_CUSTOM_DESCRIPTION_VALUE') .'/div>';
}
// DESCRIPTION UPDATE END
Code: Select all
PHOCAGALLERY_CUSTOM_DESCRIPTION_VALUE=The description text you want to display, in the appropriate language for the file.
I haven't encountered the need to support multilingual Phoca Gallery installations, but I believe this will work. Good luck.
- Jan
- Phoca Hero

- Posts: 49172
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: How to add a description in the main (parent) category?
Hi, thank you for this guide, yes this will work. If the string will be pasted to every used Phoca Gallery language string, then all will be OK.I haven't encountered the need to support multilingual Phoca Gallery installations, but I believe this will work. Good luck.
If you find Phoca extensions useful, please support the project