Siteseed.de

Utility Link | Utility Link | Utility Link

Documentation

siteseed logo

$ifcontent$ Macro

The new $ifcontent$ macro allows to create dynamic layouts depending on content of article fields.

Unlike $checkfield$ it doesn't just output true or false as an indicator for field content. With $ifcontent$ it's possible to output the complete content of a field together with appropriate HTML. So you don't rely on JavaScript for content dependent layout (e.g. for optional images) anymore. Additionally, if/else structures can now be implemented, too. Nested structures are not supported.

Note: After updating your Siteseed installation you should empty the CACHE database table of your current Siteseed installation. Just delete the entries of the CACHE table, don't delete the table itself! You may use e.g. phpMyAdmin for that.

Usage Examples of $ifcontent$

And that's how it works:

 

Example 1  - General Usage:

$ifcontentn$
 hello world
$end$
The field  #n is checked for content. If it is not empty, the string between $ifcontentn$ and $end$ is displayed. In this case that would be the string hello world. Of course, macros inside of $ifcontent$ structures will be evaluated, too.

Example 2 - General Usage:

$ifcontentn$
 foo
$else$
 bar
$end$
The field  #n is checked for content. If it is not empty, the string (foo) between $ifcontentn$ and $else$ is displayed. Otherwise the string (bar) between $else$ and $end$ would be displayed. Of course, macros inside of $ifcontent$ structures will also be evaluated.

Example 3:

$ifcontent5$
 <h1> $5$ </h1>
$end$
Field  #5 of the current article is checked for content. If it's not empty, the string '<h1> $5$ </h1>' is taken, evaluated ($5$ is replaced by the content of field #5), and displayed.

Example 4:

$ifcontent6$ 
    $5$
$else$
 <h2>There is no content in field #6</h2>
$end$
Field #6 is evaluated for content. If it keeps content, macro $5$ is evaluated, replaced by the content of field 5, and displayed. Otherwise the string '<h2>There is no content in field #6</h2>' is displayed.

Example #3:

$ifcontent5,6,7$
 <h1>There is content in field #5, #6, and #7</h1>
$else$
 <h2>There is no content in field #5, #6, and #7</h2>
$end$
Like with $checkfield$ it is also possible to check several fields at the same time. In this example field #5, field #6, and field #7 are checked. If they all keep content, the string between $ifcontent5,6,7$ and $else$ is displayed, otherwise the string between $else$ and $end$.

Of course, it can also be used like $checkfield$ macro:

$ifcontent4$true$else$false$end$ This example would be equivalent to $checkfield4$.

Printer friendly version

-

Static Section Pages The Static Section Page (Static Section) feature allows mapping of html pages to sections. These html pages may be placed/stored in any directory within the site root of your siteseed installation. The only exception are siteseed system directories (e.g. bo).


$ifcontent$ Macro The new $ifcontent$ macro allows to create dynamic layouts depending on content of article fields.


FCK Editor FCK Editor (http://www.fredck.com/FCKeditor/) is now available as Siteseed Module and can be used to replace the current visual editor. It's an external module, because it's licenced under the GNU Lesser General Public Licence (LGPL).


$php$ Macro The $php$ macro allows to execute PHP code in layouts. A set of PHP macro functions allows to access data of all other conventional macros quite easily.


Component Types The current siteseed release offers features not yet covered by the official documentation. One of these features are component types. They e.g. extend comon editor fields by predefined default content and a lot of other things.


Sitelib Documentation Sitelib is a library that encapsulates code that is often used in siteseed interfaces. This includes mainly database queries in order to achieve a higher level of abstraction and to be more independent of possible database changes in the future. This article explains all library functions and provides examples for their proper usage.


About Us | Site Map | Privacy Policy | Contact Us | © 2004 Siteseed.de
Siteseed is a trademark of Mr.Net - Serviços Informáticos, Lda