Insert some text before subcategory name

Phoca Download - download manager
michy5
Phoca Member
Phoca Member
Posts: 18
Joined: 01 Mar 2014, 21:33

Insert some text before subcategory name

Post by michy5 »

Hi,
I'm trying to customize Phoca Download and I have a question (as topic subkect): I would like to insert some text before SUBCATEGORY NAME (obviously when a subcategory is present).
I succeded in doing it for PARENT CATEGORY

Code: Select all

      $pdTitle = 'Categoria principale: <a href="'. JRoute::_(PhocaDownloadRoute::getCategoryRoute($value->id, $value->alias)).'">'.  $value->title.'</a>';
but i do not succed in doing the same for SUBCATEGORY.
I've try to edit localsite\components\com_phocadownload\views\categories\tmpl\default.php in the following but I can't do what i want:

Code: Select all

			if ($this->t['displaynumdocsecsheader'] == 1) {
				$numDocAll = (int)$numDoc + (int)$value->numdoc;
				//$numDoc ... only files in subcategories
				//$value->numdoc ... only files in the main category
				//$numDocAll ... files in category and in subcategories
				$pdTitle .= ' <small>('.$numSubcat.'/' . $numDocAll .')</small>';
			}
			
			
			$pdDesc = '';
			$pdSubcategories = '';
			if ($this->t ['displaymaincatdesc']	 == 1) {
				$pdDesc .= $value->description;
			} else {
				if ($catOutput != '') {
					$pdSubcategories .= $catOutput ;
				} else {
					$pdSubcategories .= '<div class="pd-no-subcat">'.JText::_('COM_PHOCADOWNLOAD_NO_SUBCATEGORIES').'</div>';
				}
			}
			
			$pdClear = '';
			if ($i%3==0) {
				$pdClear .= '<div class="pd-cb"></div>';
			}
			$i++;

Any suggestion?

Thanks
michy5
Phoca Member
Phoca Member
Posts: 18
Joined: 01 Mar 2014, 21:33

Re: Insert some text before subcategory name

Post by michy5 »

Hi,
I casually found the solution. The fact is that I was editing the wrong lines of code!
I write here the solution so that if someone looks for or has the same issue, they can easly find the solution:
The code to edit is more or less at the line 38 of yoursite\components\com_phocadownload\views\categories\tmpl\default.php.

My code is:

Code: Select all

$catOutput 	.= 'Sottocategoria: <a href="'. JRoute::_(PhocaDownloadRoute::getCategoryRoute($valueCat->id, $valueCat->alias))
where "Sottocategoria:" is the text i wanted to insert before sub-category name

I hope it helps.
Bye
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48550
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Insert some text before subcategory name

Post by Jan »

Ok, thank you for the info.

Jan
If you find Phoca extensions useful, please support the project
Post Reply