Product | Technical support | Version | Video exhibits | Manuals | Job Search | Contact
English   menu-arrow-gray-horizontal.gif
Home > About the Product > Protection of the projects under Visual PHP™
Related information
Search


Video demonstration
Drag&drop in the Visual PHP™ Environment

Latest video samples:
Job Search
Company
E-VISION International s.r.o.

is looking for PHP 5 and JavaScript programmers for long-term cooperation.




More information ...
Wrote about Visual PHP™
News by e-mail
Your e-mail

Visual PHP Recommends
For Visual PHP™
(for work in both the developer and the administration interface), we recommend using the Mozilla Firefox web browser, on the basis of which the whole software is developed because of stability, complying with the W3C standards and protecting elements of the browser.

A Tabular List of Goods in an E-shop

There are increases in the number of questions how to display a list of goods in Visual PHP™ so that a visitor can switch between the display with images and the tabular output without images.

The principle is quite easy. You have only to have 2 templates named m_shop_catalogue for the list of records (original one and a new one with a table). Which template shall be used by the system is determined by means of a condition.

Creating a Tabular List Template

Let’s create a new template named m_shop_catalogue with the List of Records (vtList) display mode. We enter the following code into the template:

<table style="width: 100%;" border="0" cellpadding="0" cellspacing="4">
  <thead>
    <tr style="font-weight: bold">
      <th>Name</th>
      <th>Producer</th>
      <th>Price</th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a href="m_shop_catalogue.php?id=[id]">[name]</a></td>
      <td>[producer]</td>
      <td>[taxPrice]</td>
      <td><a href="m_shop.php?m_shop_actionType=addItem&m_shop_tableName=m_shop_catalogue&m_shop_id=[id]">do košíku</a></td>
    </tr>
  </tbody>
</table>
Visual PHP™ allows you to create also complete tables by means of templates. When processing a template with one record, the <table> and the complete <thead> tags including nested tags will be inserted and further the <tbody> tag and its content without the </tbody> end will be inserted. During the subsequent processing of the template with the other records, only the <tr> tag and its content are inserted and </tbody></table> will be added at the end of the last record. A valid full-value table will be generated this way where all columns are aligned.

However, let’s return to the substance of this article. It is also necessary to set a condition for the aforementioned template:
$view == "table"
This condition will distinguish which of the templates will be displayed. If the $view variable has a value of “table”, then only this template will be used. If it be to the contrary, the original template with images will be used because that template does not have set this condition.

If we want to test template switching, we have only to enter this URL for common display into the browser:
http://www.domena.cz/m_shop_catalogue.php
and this URL for a tabular list:
http://www.domena.cz/m_shop_catalogue.php?view=table
Now we have only to place links to these 2 display modes in any place within the presentation (in the m_shop_catalogue layout as standard) so that also visitors can switch between the displays.

Modifying a Layout for Displaying a Tabular List

Considering that much more items can be placed in a tabular list, it is also suitable to increase the number of items being displayed for this display mode. Therefore, it is necessary to increase the Items per Page property for the Table Content component in the m_shop_catalogue layout for a list of records.

We have 2 options how to do it. Either we will have 2 separate m_shop_catalogue layouts with the same name and display mode, where the layout for a tabular list is distinguished by means of the same condition as the template for a tabular list has, or we can have 1 layout only and enter 20 instead of a fixed number into the Items per Page property. It is only up to you which of these options you will select or what the design of your pages will require.







NOTICE

Some properties published in this article can only be functional with the latest core version. If you have any older core version, we recommend you to update to the latest version.

Login
Free trial

for 30 days
Latest core version
Single Developer 1.7.9.680
january 20, 2012

Professional 1.7.9.680
january 20, 2012

Enterprise 1.7.9.680
january 20, 2012


Latest developer guide
Developer Guide 1.0.5
july 10, 2009 9:36:42 AM

Latest user guide
Administrator Guide 1.0.24
august 27, 2010 11:58:08 AM

Latest install script
install.php 1.9.22
april 12, 2012 6:02:40 PM

Comming up in next version
more ...

rss.gif
Support

Fotogalerie 5/10/2012
Section: Tvorba prezentací
Chyba v hromadné korespondenci, nelze odeslat příloha (nová verze 4/6/2012
Section: Bug reporty
AntiSpam obrázek 4/6/2012
Section: Programování
Chyba při opravách textů 4/4/2012
Section: Bug reporty
Admin může smazat Developera, je to ok? 3/27/2012
Section: Bug reporty
Mapa webu 3/19/2012
Section: Tvorba prezentací


rss.gif
News

Weather Component Update
november 18, 2011
Server weather.com decided to stop providing weather information for free and passed to the paid version (about $ 60 per month). For this reason, we were forced to modify the Weather component to pulling weather information from another data source, namely from the server www.worldweatheronline.com . This site also provides information about weather all around the world, but the amount of information is smaller than the original source.

For proper functionality of the Weather component please update core to version 1.7.9.638.
Added new tutorials
october 4, 2011
He added new instructions Using another HTML editor
Powered by Visual PHP ™
© 2008 - 2010 E-VISION International, s.r.o.
Product | Technical support | Version | Video exhibits | Manuals | Job Search | Contact