How to have category name beneath thumbnail?

Phoca Gallery - image gallery extension
richpig
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 07 May 2009, 20:00

How to have category name beneath thumbnail?

Post by richpig »

Hi

I can't seem to find an answer to this on the forum so hope someone can help!

I'm using the Category List layout for my gallery, with the thumbnail image and the category name next to it. But I want the category name to appear beneath the thumbnail, not to the right of it.

Does anyone know how to re-position it?

It seems the category list page is made up from table cells and I need the category images and category names to be in separate rows rather than columns.

Appreciate it if anyone has any ideas!

Thanks :x
richpig
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 07 May 2009, 20:00

Re: How to have category name beneath thumbnail?

Post by richpig »

Managed to work it out :D

In case anyone else should ever want to, this worked for me:

Open the default.php file in the views -> categories -> tmpl folder
The code starts at line 64 with this:

echo '<tr>';
echo '<td align="center" valign="middle" style="'.$this->tmpl['imagebg'].';text-align:center;"><a href="'.$this->categories[$i]->link.'">'.JHTML::_( 'image.site', $this->categories[$i]->linkthumbnailpath, '', '', '', $this->categories[$i]->title, 'style="border:0"' ).'</a></td>';

echo '<td align="center"><a href="'.$this->categories[$i]->link.'" class="category'.$this->params->get( 'pageclass_sfx' ).'">'.$this->categories[$i]->title.'</a>&nbsp;';

if ($this->categories[$i]->numlinks > 0) {echo '<span class="small">('.$this->categories[$i]->numlinks.')</span>';}

echo '</td>';
echo '</tr>';

I added a new echo '<tr>'; in between the first closing </td> and next opening <td>...

echo '<tr>';
echo '<td align="center" width="140px" height="130px" valign="middle" style="'.$this->tmpl['imagebg'].';text-align:center;"><a href="'.$this->categories[$i]->link.'">'.JHTML::_( 'image.site', $this->categories[$i]->linkthumbnailpath, '', '', '', $this->categories[$i]->title, 'style="border:0"' ).'</a></td>';
echo '<tr>';
echo '<td align="center" height="30px"><a href="'.$this->categories[$i]->link.'" class="category'.$this->params->get( 'pageclass_sfx' ).'">'.$this->categories[$i]->title.'</a>&nbsp;';

if ($this->categories[$i]->numlinks > 0) {echo '<span class="small">('.$this->categories[$i]->numlinks.')</span>';}

echo '</td>';
echo '</tr>';
echo '</tr>';

And also a closing echo '</tr>'; and then also some width and height settings to make things layout nicely.

I'm happy punter once more, phoca is a great gallery!

Cheers
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: How to have category name beneath thumbnail?

Post by Jan »

Great. Thank you for sharing your solution.

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