Перейти к содержимому


Фотография
- - - - -

How to create a table?


Лучший Ответ SmetDenis , 23 July 2013 - 09:56

Hi

So sorry for my late reply.

Create Item teaser template, as example

media/zoo/applications/jbuniversal/templates/catalog/renderer/item/<TYPE ALIAS>/teaser.php

<?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>
Define new placeholders in positions.xml
<?xml version="1.0" encoding="utf-8"?>
<renderer>

   <!-- add this block -->
   <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>
   <!-- /add this block -->

</renderer>
Create new template in

media/zoo/applications/jbuniversal/templates/catalog/renderer/item_columns/<APP ALIAS>.php
for example
<?php
defined('_JEXEC') or die('Restricted access');
$this->app->jbassets->tablesorter(); // include jQuery Tablesorter JS+CSS
 
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>
 
    <!-- table sorter jQuery plugin -->
    <script type="text/javascript">
        jQuery(function ($) {
            $('.jsTableSorter').tablesorter({});
        });
    </script>
<?php endif;
Also you can choose template in category configurations
ssmbb017cb4_200x0.png

 
Sorry, but images can be uploaded only our subscribers. Try using free services for screenshots. Перейти к сообщению


  • Закрытая тема Тема закрыта
Сообщений в теме: 3

#1 david052010

david052010

Отправлено 21 July 2013 - 16:13

hi,i need to create a template like to table. i had read the Apps for JBZOO by the link:http://jbzoo.com/download.php so i know it can create a template like to table by Jbzoo. but i do not how to create it . can you let me know that how to do step by step?
  • 0

#2 Adrian

Adrian

Отправлено 21 July 2013 - 18:56

use the Запись базы данных (record database)  or the

Квартира (apartment)

type


  • 0

#3 david052010

david052010

Отправлено 22 July 2013 - 17:24

hi  Adrian,thanks for your reply.

i had use the Запись базы данных (record database)  or the Квартира (apartment) last night.

but their style look like that:

 

 

Capacitor 111 222 333 444 666 555
 
Capacitor 111 222 333 444 666 555
 
Capacitor 111 222 333 444 666 555
 
 
i hope the style is like this:
 
 

 

Part Number
Description
Manufacturer
Availability
Package

Datasheet

Details
0MAX020.X
FUSE SLO BLOW BLADE MAXI 20A
Littelfuse Inc
186,941
Blade Type

pdf.png

Enquiry

0MAX020.XPGLO
FUSE BLADE MAXI 20A YELLOW 1PER
Littelfuse Inc
103,905
Blade Type

pdf.png

Enquiry

0MAX030.X
FUSE SLO BLOW BLADE MAXI 30A
Littelfuse Inc
123,929
Blade Type

pdf.png

Enquiry

0MAX030.XPGLO
FUSE BLADE MAXI 30A GREEN 1PER P
Littelfuse Inc
155,411
Blade Type

pdf.png

Enquiry

0MAX040.X
FUSE SLO BLOW BLADE MAXI 40A
Littelfuse Inc
195,947
Blade Type

pdf.png

Enquiry



how upload the image???


  • 0

#4 SmetDenis

SmetDenis

Отправлено 23 July 2013 - 09:56   Лучший Ответ

Hi

So sorry for my late reply.

Create Item teaser template, as example

media/zoo/applications/jbuniversal/templates/catalog/renderer/item/<TYPE ALIAS>/teaser.php
<?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>
Define new placeholders in positions.xml
<?xml version="1.0" encoding="utf-8"?>
<renderer>

   <!-- add this block -->
   <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>
   <!-- /add this block -->

</renderer>
Create new template in

media/zoo/applications/jbuniversal/templates/catalog/renderer/item_columns/<APP ALIAS>.php
for example
<?php
defined('_JEXEC') or die('Restricted access');
$this->app->jbassets->tablesorter(); // include jQuery Tablesorter JS+CSS
 
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>
 
    <!-- table sorter jQuery plugin -->
    <script type="text/javascript">
        jQuery(function ($) {
            $('.jsTableSorter').tablesorter({});
        });
    </script>
<?php endif;
Also you can choose template in category configurations
ssmbb017cb4_200x0.png

 
Sorry, but images can be uploaded only our subscribers. Try using free services for screenshots.
  • 0
JBZoo v4.0 и новый чудный мир Open Source GPL
Отключайте проверку лицензий как можно скорее!



— Есть два типа людей: Кто еще не делает бекапы и кто уже делает бекапы.





Click to return to top of page in style!