A common needs while working with Contao is to set the page title from a frontend module or inside a template.
Tuesday, December 15, 2009
Friday, November 6, 2009
Quick tip: How to remove .html extension from url with TYPOlight
A quick tutorial showing how to remove “.html” suffix from the url of your website
- Go to “Settings” (it’s under “System” section), make sure to set:
- URL suffix: empty the field
- Rewrite URLs: checked
- Disable page alias usage: unchecked
Open the “.htaccess” (it is located into the root of your website) and replace the line containing
RewriteRule .*\.html$ index.php [L]
with:
RewriteRule .* index.php [L]
That’s all.
Thursday, October 29, 2009
Select configuration: Manage options
to use it in your Data Container Array please add
'my_field' => array(
// ... field configuration entries
'inputType' => 'select',
// ... field configuration entries
);
to the field configuration as ‘select’ is the corresponding alias for the SelectMenu widget
It features data retrieving from the following sources:
- an array
- a foreign field from a custom table
- a custom callback
Wednesday, October 28, 2009
ZedSeries Help System released
Hi all,
today I've released ZedSeries Help System, an extension that let developers creating manuals of their own extensions and distributing them with the extension. It is available in the official repository so can be installed through the Extension Catalog
Tuesday, October 27, 2009
ZedSeries Listing new class available in version 1.5
<?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.
Validators in ZedSeriesWizard
About writing validators using ZedSeriesWizard
Customizing a wizard
Learn how to customize wizards created with ZedSeriesWizard
Getting started with ZedSeriesWizard
How to create a simple wizard using ZedSeries Library extension for TYPOlight webCMS
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.
New posts are coming
I am moving all the articles from zedseries.com here. This place will also contain articles tips and tricks on development with TYPOlight webCMS.
Hope you enjoy it.