Showing posts with label zedseries_listing. Show all posts
Showing posts with label zedseries_listing. Show all posts

Monday, July 5, 2010

ZedSeries Listing Tutorial (part #1)

Today was released ZedSeries Listing 1.6.0.stable, it is compatible with Contao 2.9 and is shipped with an inline guide. The following tutorial is taken from the inline guide. The project page is located at http://www.zedseries.com/zedseries-listing-extension-for-typolight.html. The issues are managed through bitbucket at http://bitbucket.org/zedseries/zedseries_listing/issues/. You can also visit the project page of ZedSeries Listing on Contao.org website.

Saturday, February 27, 2010

ZedSeries Listing v. 1.6.x: search system improved

From version 1.6.x (currently in rc1) ZedSeries Listing introduces a new search system to improve the search experience of the users of your website.

Basically it allows users to select more than just one field.

The new interface is composed by two select and one text field

zedseries_listing_search_ui

Compared to the previous interface now user can choose not only the field to filter but also the comparison operator. Multiple conditions can be added easily clicking on the green plus sign or deleted clicking on the red x.

Currently the supported operators are the following:

  • equal
  • greater than
  • equal or greater then
  • lower than
  • equal or lower than
  • starts with
  • contains
  • ends with

 

Next release will contain the option to show only selected operators.

Tuesday, October 27, 2009

ZedSeries Listing new class available in version 1.5

Starting from version 1.5 ZedSeries Listing features a class that let you create listing with a few lines of code:
<?php
// put this inside your Module's compile method to give a quick try

// in this example we'll query the tl_page table
// we pass $this->Template to assign vars to current template

// set "tl_page" as namespace
$l = new ZedSeriesListing('tl_page');

// you can set "frontend module" params through php code

$l->setFields('id,pageTitle,language');
$l->setSearchFields('pageTitle');
$l->setWhere('published = 1');
$l->setSorting('tstamp DESC');
$l->setPaging(5);

$l->query();
// $this->Template is created automatically by the (Backend|Frontend)Module
$lt = new ZedSeriesListingTemplate($l, $this->Template);
$lt->assignListingVars();
$lt->assignSearchVars();
$lt->assignPaginationVars();

ZedSeries Listing: template changes from version 1.5

Starting from version 1.5 the zslist_default.tpl has changed. So if you upgrade your ZedSeries Listing extension (that is highly recommended) you need to apply the following changes to templates/zslist_default.tpl.

Please upgrade your template in this way: (remove the lines starting with a dash and add the ones which start with a plus sign)

-<input type="hidden" name="<?php echo $this->ns; ?>_order_by" value="<?php echo $this->order_by; ?>" />
-
<input type="hidden" name="<?php echo $this->ns; ?>_sort" value="<?php echo $this->sort; ?>" />
-
<input type="hidden" name="<?php echo $this->ns; ?>_per_page" value="<?php echo $this->per_page; ?>" />
-
<select name="<?php echo $this->ns; ?>_search" class="select">
+
<input type="hidden" name="<?php echo $this->nsorderby; ?>" value="<?php echo $this->Input->get($this->nsorderby); ?>" />
+
<input type="hidden" name="<?php echo $this->nsdirsort; ?>" value="<?php echo $this->Input->get($this->nsdirsort); ?>" />
+
<input type="hidden" name="<?php echo $this->nsperpage; ?>" value="<?php echo $this->per_page; ?>" />
+
<select name="<?php echo $this->nssearch; ?>" class="select">
-
<input type="text" name="<?php echo $this->ns; ?>_for" class="text" value="<?php echo $this->for; ?>" />
+
<input type="text" name="<?php echo $this->nsfor; ?>" class="text" value="<?php echo $this->for; ?>" />
-
<input type="hidden" name="<?php echo $this->ns; ?>_order_by" value="<?php echo $this->order_by; ?>" />
-
<input type="hidden" name="<?php echo $this->ns; ?>_sort" value="<?php echo $this->sort; ?>" />
-
<input type="hidden" name="<?php echo $this->ns; ?>_search" value="<?php echo $this->search; ?>" />
-
<input type="hidden" name="<?php echo $this->ns; ?>_for" value="<?php echo $this->for; ?>" />
-
<select name="<?php echo $this->ns; ?>_per_page" class="select">
-
<option value="10"<?php if ($this->per_page == 10): ?> selected="selected"<?php endif; ?>>10</option>
-
<option value="20"<?php if ($this->per_page == 20): ?> selected="selected"<?php endif; ?>>20</option>
-
<option value="50"<?php if ($this->per_page == 50): ?> selected="selected"<?php endif; ?>>50</option>
-
<option value="100"<?php if ($this->per_page == 100): ?> selected="selected"<?php endif; ?>>100</option>
-
<option value="250"<?php if ($this->per_page == 250): ?> selected="selected"<?php endif; ?>>250</option>
-
<option value="500"<?php if ($this->per_page == 500): ?> selected="selected"<?php endif; ?>>500</option>
+
<input type="hidden" name="<?php echo $this->nsorderby; ?>" value="<?php echo $this->Input->get($this->nsorderby); ?>" />
+
<input type="hidden" name="<?php echo $this->nsdirsort; ?>" value="<?php echo $this->Input->get($this->nsdirsort); ?>" />
+
<input type="hidden" name="<?php echo $this->nssearch; ?>" value="<?php echo $this->search; ?>" />
+
<input type="hidden" name="<?php echo $this->nsfor; ?>" value="<?php echo $this->for; ?>" />
+
<select name="<?php echo $this->nsperpage; ?>" class="select">
+
<?php echo $this->perPage_fields; ?>
-
<td class="body <?php echo $this->col_last; ?> col_last"><a href="<?php echo $row['details_href']; ?>"><img src="system/modules/zedseries_listing/media/images/details.gif" alt="" /></a></td>
+
<td class="body col_last"><a href="<?php echo $row['details_href']; ?>"><img src="system/modules/zedseries_listing/media/images/details.gif" alt="" /></a></td>








These changes are very easy to apply but if you need help try asking below. Thank you.

Monday, October 26, 2009

ZedSeries Listing: How to use helper in template writing

ZedSeries Listing set a template variable named fh that can be used for  better customize our listing template.

A little example for clarifying how the help can be used:

For the following example we assume that we are querying the pageTitle,language and tstamp fields from tl_page to show some pages of our website with creation date.

<div<?php echo $this->cssID; ?>
<?php if ($this->style): ?>
style
="<?php echo $this->style; ?>"
<?php endif; ?>>
<?php foreach ($this->tbody as $class=>$row): ?>
<p>
<small><?php echo $this->thead[$this->fh->pageTitle]['link']; ?></small>:
<?php echo $row[$this->fh->pageTitle]['content']; ?>
</p>
<p>
<small>Created on</small>:
<?php echo date("Y-m-d H:i:s", $row[$this->fh->tstamp]['raw']); ?>
</p>
<hr />
<?php endforeach; ?>
</div>



As shown above we can use $this->fh->%fieldname% to refer to our fields: so we can displays them without worrying about select order.