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


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

how to create table for the search result???


Лучший Ответ SmetDenis , 18 April 2014 - 06:58

Hello David

I recomend you the next way

1.
Look the alias of your catalog
hzc_200x0.png

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"
d0g_200x0.png g5d_200x0.png


Please, follow all recomensations from documentation step by step, not more.

 

Or show me on screenshort all your actions.


Best regards, Denis.

Перейти к сообщению


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

#1 david052010

david052010

Отправлено 16 April 2014 - 18:54

how to create table for the search result???

 

i had create table for teaser page.like the image:

2000.jpg

but the JBZoo Search result is difference with the teaser,like the image:

 2000.jpg

i hope the search result like the teaser.please help.

wait for your reply.

thanks!


  • 0

#2 SmetDenis

SmetDenis

Отправлено 17 April 2014 - 07:32

Hi

About table layout you can find information here - http://jbzoo.com/docs/table-layout

Can you tell me please, how you customized templates and what changes have been done ?
Please, attach screens or template files.

Thanks a lot.

 


  • 0
JBZoo v4.0 и новый чудный мир Open Source GPL
Отключайте проверку лицензий как можно скорее!



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


#3 david052010

david052010

Отправлено 17 April 2014 - 09:52

Step 1:    choose template in category configurations 

2000.jpg

Step 2: choose application in item configurations(application:Table item)

 

Finish!


  • 0

#4 david052010

david052010

Отправлено 17 April 2014 - 10:06

Hi SmetDenis :)

I had read the article.http://jbzoo.com/docs/table-layout

but i do not know how to do for search result page.

I have try to revise the filter.php file. and can not achieve results.

 

Dear SmetDenis,I really need your help.

can you tell me how to archieve the search result page same to teaser page?

and tech me step by step!

PLEASE PLEASE PLEASE!!!!! :( 


  • 0

#5 SmetDenis

SmetDenis

Отправлено 17 April 2014 - 12:33

Hi David

 

I recomened you rename files to <catalog_alias>.php

 

Or, maybe you can give me temporary FTP access to your website,

So I will configure filter for you.

 

Best regards, Denis.


  • 0
JBZoo v4.0 и новый чудный мир Open Source GPL
Отключайте проверку лицензий как можно скорее!



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


#6 david052010

david052010

Отправлено 18 April 2014 - 04:11

Hi SmetDenis

 

Thanks for your reply.

my site is in my localhost.and my english is not good,so i do not how to describe my problem and my details operate. 

I had visited  the demo site(http://demo.jbzoo.com/).

In the menu Catalog or Table or Database, the filter result page is same to teaser page.

how you do that?That is what i need and my solution.

so i need you tell me that you how to let the filter result page is same to teaser page in demo site.

I know i am otherwise.but i join the subscribers,just hope  solve the problem.

wait for your reply.


  • 0

#7 SmetDenis

SmetDenis

Отправлено 18 April 2014 - 06:58   Лучший Ответ

Hello David

I recomend you the next way

1.
Look the alias of your catalog
hzc_200x0.png

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"
d0g_200x0.png g5d_200x0.png


Please, follow all recomensations from documentation step by step, not more.

 

Or show me on screenshort all your actions.


Best regards, Denis.


  • 0
JBZoo v4.0 и новый чудный мир Open Source GPL
Отключайте проверку лицензий как можно скорее!



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


#8 david052010

david052010

Отправлено 18 April 2014 - 19:14

Hi SmetDenis

 

Very very very thank you for your help.

your help has meant a lot to me.

Now,my problem had solved.

Thanks again.

I had another question for the running speed of JBZOO .


  • 0




Click to return to top of page in style!