(solved) category view

Phoca Gallery - image gallery extension
chrissy6930
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 09 Jun 2011, 18:48

(solved) category view

Post 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
Last edited by chrissy6930 on 15 Jun 2011, 08:46, edited 2 times in total.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49190
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: category view

Post 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
If you find Phoca extensions useful, please support the project
chrissy6930
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 09 Jun 2011, 18:48

Re: category view

Post 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 ...
chrissy6930
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 09 Jun 2011, 18:48

Re: category view

Post by chrissy6930 »

any news on this matter ?
dethisandthat
Phoca Member
Phoca Member
Posts: 13
Joined: 17 Sep 2010, 11:09

Re: category view

Post 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
chrissy6930
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 09 Jun 2011, 18:48

Re: category view

Post by chrissy6930 »

thanks for the hint dethisandthat ! :D
Post Reply