Best Answer SmetDenis , 18 April 2014 - 06:58
Hello David
I recomend you the next way
1.
Look the alias of your catalog
2.
Create new template file here
/media/zoo/applications/jbuniversal/templates/catalog/renderer/item_columns/<CATALOG_ALIAS>.php
with code
<?php defined('_JEXEC') or die('Restricted access'); $this->app->jbassets->tablesorter(); // adding sorting library if ($vars['count']) : ?> <table class="jsTableSorter tablesorter zebra"> <caption>Table</caption> <thead> <tr> <th>ID</th> <th>Name</th> <th>Image</th> <th>Field 1</th> <th>Field 2</th> <th>Field 3</th> </tr> </thead> <tbody> <?php foreach ($vars['objects'] as $object) : echo $object; endforeach; ?> </tbody> </table> <!-- sorting initialization --> <script type="text/javascript"> jQuery(function ($) { $('.jsTableSorter').tablesorter({}); }); </script> <?php endif;
3.
Open this folder:
media/zoo/applications/jbuniversal/templates/catalog/renderer/item
(let's call this folder <ITEM-TPL> for convenience).
4.
Create a new folder named "table-item":
<ITEM-TPL>/table-item/ Copy these files in it: <ITEM-TPL>/full.php ==> <ITEM-TPL>/table-item/full.php <ITEM-TPL>/teaser.php ==> <ITEM-TPL>/table-item/teaser.php <ITEM-TPL>/metadata.xml ==> <ITEM-TPL>/table-item/metadata.xml <ITEM-TPL>/positions.xml ==> <ITEM-TPL>/table-item/positions.xml
5.
Code of teaser.php file
<?php defined('_JEXEC') or die('Restricted access'); ?> <tr class="table-row item_<?php echo $item->id;?>"> <td><?php echo $item->id; ?></td> <td><?php echo $this->renderPosition('cell1'); ?></td> <td><?php echo $this->renderPosition('cell2'); ?></td> <td><?php echo $this->renderPosition('cell3'); ?></td> <td><?php echo $this->renderPosition('cell4'); ?></td> <td><?php echo $this->renderPosition('cell5'); ?></td> </tr>
6.
Code of positions.xml
<?xml version="1.0" encoding="utf-8"?> <renderer> <positions layout="full"> <position name="title">Title</position> <position name="image">Image</position> <position name="properties">Properties</position> <position name="text">Text</position> <position name="meta">Meta</position> </positions> <positions layout="teaser"> <position name="cell1">Table cell #1</position> <position name="cell2">Table cell #2</position> <position name="cell3">Table cell #3</position> <position name="cell4">Table cell #4</position> <position name="cell5">Table cell #5</position> </positions> </renderer>
7.
Create new item type with alias "table-item"
Please, follow all recomensations from documentation step by step, not more.
Or show me on screenshort all your actions.
Best regards, Denis.