Page 1 of 1

Change categories view in Joomla ?!

Posted: Wed Aug 11, 2010 7:03 pm
by FlaShow
Hello,



I'm using Joomla 1.5.20 CMS and I create a button to display a list of Categories in Section name Anime, the categories list are:
Action - Adventure - Comedy - Drama - Slice of life - Fantasy - Magic - Supernatural - Horror - Mystery - Psychological - Romance - Science fiction - Thriller - Sport - Super robots.
I don't want to display the list of categories vertically but to display a image and below it the category name like this:
Image

This is the code i want to modify:

Code: Select all

<?php // no direct access
defined('_JEXEC') or die('Restricted access');
$cparams =& JComponentHelper::getParams('com_media');
?>
<?php if ($this->params->get('show_page_title', 1)) : ?>
<div class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
    <?php echo $this->escape($this->params->get('page_title')); ?>
</div>
<?php endif; ?>
<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center" class="contentpane<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
<tr>
    <td valign="top" class="contentdescription<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" colspan="2">
    <?php if ($this->category->image) : ?>
        <img src="<?php echo $this->baseurl . '/' . $cparams->get('image_path') . '/'. $this->category->image;?>" align="<?php echo $this->category->image_position;?>" hspace="6" alt="<?php echo $this->category->image;?>" />
    <?php endif; ?>
    <?php echo $this->category->description; ?>
</td>
</tr>
<tr>
    <td>
    <?php
        $this->items =& $this->getItems();
        echo $this->loadTemplate('items');
    ?>

    <?php if ($this->access->canEdit || $this->access->canEditOwn) :
            echo JHTML::_('icon.create', $this->category  , $this->params, $this->access);
    endif; ?>
    </td>
</tr>
</table>

I want 4 Columns and dynamic number of rows. How to do that ?!



Best Regards,
FlaShow

Re: Change categories view in Joomla ?!

Posted: Wed Aug 11, 2010 8:08 pm
by John Cartwright
Without going through your Joomla code (which I've never used prior), you can use CSS to create the desired effect without any programming logic.

Let me show you an example you can apply to your own issue,

Code: Select all

$movies  = array(
   'Iron Man 2', 
   'The Expendables', 
   'Animal Kingdom', 
   'The Other Guys', 
   'Inception',
   'Step Up 3D',
   'Salt',
   'Dinner for Schmucks'
);

foreach ($movies as $title) {
   echo '<div style="float: left; width: 19%;">'. $title .'</div>';
}
echo '<div style="clear: both;"></div>';
Which would result in something like

[text]Iron Man 2 | The Expendables | Animal Kingdom | The Other Guys | Inception
Step Up 3D | Salt | Dinner for Smucks[/text]

Re: Change categories view in Joomla ?!

Posted: Thu Aug 12, 2010 1:28 pm
by FlaShow
thanks John Cartwright

The problem is i don't know anything about PHP or CSS :( so i don't know how to modify the code above... !!!

If you can explain how the script above work i will try to modify the code myself