Page 1 of 1

(solved) category view

Posted: 09 Jun 2011, 18:58
by chrissy6930
hi everybody,

on the list of sub categories in category view I would like to display the description of the respective category
it should look somewhat like this:

<a>$category_title</a> ($num_imgs Images)
$category_description

I have adjusted in ../views/category/tmpl/default.php:

Code: Select all

// subfolder
if ($value->type == 1) {
   if ($value->displayname == 1 || $value->displayname == 2) {
      echo '<div class="phocaname" style="font-size:'.$this->tmpl['fontsizename'].'px">'
      .PhocaGalleryText::wordDelete($value->title, $this->tmpl['charlengthname'], '...').'</div>';
   }
}
for:

Code: Select all

// subfolder
if ($value->type == 1) {
   if ($value->displayname == 1 || $value->displayname == 2) {
      echo '<div class="phocaname" style="font-size:'.$this->tmpl['fontsizename'].'px">'
      .PhocaGalleryText::wordDelete($value->title, $this->tmpl['charlengthname'], '...').'</div>';
   }
   echo '<br />'.$value->description;
}
however the cat description is not being displayed
there is no error
in firebug the br tag is being displayed

could somebody please help me figure what wrong ? maybe the query doesn't pull the cat description ? if so where is the relevant query?

J!1.5.23, PG 2.7.6, php error reporting enabled

Re: category view

Posted: 10 Jun 2011, 16:50
by Jan
Hi, just print_r the $value to see which object items it includes, if there is no category description, this needs to be loaded in model of the category view.

Jan

Re: category view

Posted: 10 Jun 2011, 17:51
by chrissy6930
good idea! I var_dumped $value which reveals (partial display)

["id"]=> string(2) "45"
["parent_id"]=> string(2) "36"
["owner_id"]=> string(2) "62"
["title"]=> string(15) "Umzug Oberursel"
["name"]=> string(0) ""
["alias"]=> string(15) "umzug-oberursel"
["image"]=> string(0) ""
["section"]=> string(0) ""
["image_position"]=> string(4) "left"
["description"]=> string(0) ""
["date"]=> string(19) "2011-03-07 15:34:54"
["published"]=> string(1) "1"

that looks like the image description (which is currently blank for all images) is being pulled but not the category description. apart from title / alias nothing of the category is being listed there.

hmmm now what query would I need to modify ? I would have thought its in models/category.php ...

Re: category view

Posted: 14 Jun 2011, 12:46
by chrissy6930
any news on this matter ?

Re: category view

Posted: 14 Jun 2011, 16:53
by dethisandthat
I think the description is set to '' in the below file.
\Joomla\components\com_phocagallery\views\category\view.html.php

somewhere in the file view.html.php
blah blah...
if ($display_subcat_page == 1) {
blah blah...
//$items[$iS]->description = ''; //here i commented it
$items[$iS]->description = $items[$iS]->description;

\Joomla\components\com_phocagallery\views\category\tmp\default.php
somewhere in the file default.php
blah blah...
if ($value->type == 1) {
print_r($value); //here i could see my description

Re: category view

Posted: 15 Jun 2011, 08:45
by chrissy6930
thanks for the hint dethisandthat ! :D