Tuesday 16 May 2006 1:44:00 am
The three banners on the frontpage are all displayed using the same view mode (called banner).
The override settings for this view mode are shown below, and are stored in the file settings/siteaccess/news/override.ini.append.php.
# Override for image in banner view mode [image_banner] Source=node/view/banner.tpl MatchFile=banner/image.tpl Subdir=templates Match[class_identifier]=image
The banner used in our news portal is simply an image. The template code for displaying this banner is:
<div style="clear:both"> <p> {attribute_view_gui attribute=$node.object.data_map.image image_class=banner} </p> </div>
The banner is displayed via the attribute_view_gui function. The parameters specify the image to display and the image alias banner. To link the banner to a URL, supply an additional href parameter to the attribute_view_gui function.
The banner image has a specific maximum dimension. To make eZ publish scale images we need to define an alias for the image. In this case we will call our image alias banner. This alias ensures that the image is not larger than 560 pixels wide and 70 pixels high. The configuration is stored in settings/siteaccess/news/image.ini.append.php.
[AliasSettings] AliasList[]=banner [banner] Reference= Filters[] Filters[]=geometry/scaledownonly=560;70