This page is deprecated. Information on this page is intended for DF/Manager 1.4.6 and older only. For DF/Manager 1.5 and newer, please visit http://dfmanager.com/help/pages/elements

Elements are small blocks of presentation code encapsulated so they can be easily reused. Elements are placed in view files and must be placed between PHP tags (<? and ?>) and preceded by an echo command:

<? echo $this->element('element_name'); ?>

The element_name specifies which element is being called.

Element parameters

Most elements can take one or more parameters. Passing parameters to an element is done by passing an array:

<? echo $this->element('element_name', array('key' => 'value')); ?>

Example: suppose you want to use the compilations element to output products in the featured-products compilation. You want to display products in a grid, so your using the thumbs template. This is the code you should use:

<? echo $this->element('compilations', array('name' => 'featured-products', 'template' => 'thumbs')); ?>

Element caching

All elements accept one special parameter: cache. To turn on caching for an element, set its 'cache' parameter to true:

<? echo $this->element('actions', array('cache' => true)); ?>

Note how we're passing a boolean value true, without quotes. The default cache time is 1 day.

If you render the same element more than once in a view and have caching enabled be sure to set the 'key' parameter to a different name each time. This will prevent each succesive call from overwriting the previous element() call's cached result. E.g.

<? echo $this->element('actions', array('cache' => array('key' => 'first_use', 'time' => '+1 day'))); ?>

Because we now specify a cache key we cannot simply set 'cache' to true. We must now manually set the caching time as well using the 'time' parameter.

DF/Manager elements


The Actions element show the merchant's actions, like sales or special vouchers. The Actions plugin is required for this element.

By default Actions are displayed at the top of the home page and on every product detail page. The home page displays all active actions, the product detail pages show only active actions of the related merchant (e.g. Actions of merchant X only show up on product pages of merchant X).


  • actions


  • string location (required)
    • Location where actions are displayed, either 'home' or 'product'. Default is 'home'.
  • boolean animate
    • Optional value to turn animation on or off. Animation fades actions in and out view. Requires multiple actions to be active.
  • string class
    • Optional css class to attach to actions for custom styling. Default is 'dfm-actions'.
  • int feed_id
    • Optional Feed-ID. If supplied, only actions of the merchant related to the specified feed are shown. If omitted all actions are shown.
  • mixed cache
    • true/false or 'key' / 'time': array('key' => 'your_key', 'time' => '+1 day')

Category tree

The Category tree element shows a tree of categories, managed in the administrator pages.


  • category_tree


  • mixed cache
    • true/false or 'key' / 'time': array('key' => 'your_key', 'time' => '+1 day')


The Compilations plugin is required for this plugin.


  • compilations


  • string name (required)
    • Name of the compilation to show.
  • string template (required)
    • Name of the template, either 'thumbs' or 'tiny-list'.
  • string title
    • Optional title to show above compilation. Default is title stored in database.
  • string before_text
    • Optional text to show before the compilation. Default is text stored in database.
  • string after_text
    • Optional text to show after the compilation. Default is text stored in database.
  • number columns
    • Optional number of columns for grid view templates. Default is 4.
  • mixed cache
    • true/false or 'key' / 'time': array('key' => 'your_key', 'time' => '+1 day')


This example displays the featured-products compilation using a 4-column grid template. The element is cached for 1 hour:

<?php echo $this->element('compilation', array('name' => 'featured-products', 'template' => 'grid', 'columns' => 4, 'cache' => array('key' => 'home', 'time' => '+1 hour')));?>

The same compilation, now using a list template and no caching. Note that the list template ignores column settings so are not given here:

<?php echo $this->element('compilation', array('name' => 'featured-products', 'template' => 'list')));?>

Merchant logos

The Merchant logos displays a block with merchant logos or merchant names. Merchant logo urls can be entered with every feed. If the logo url is empty, the merchant's name is displayed.


  • merchant_logos


  • mixed cache
    • true/false or 'key' / 'time': array('key' => 'your_key', 'time' => '+1 day')

Random products

This element shows a list or grid of randomly selected products. The number of products can be set with the limit parameter. The conditions parameter allows you to apply a filter to the random selection in the form of a SQL statement.

Example: to show only random products of NIKE products use whis condition:

'conditions' => 'Product.brand = \'NIKE\''

or to show only products priced between 10 and 20 dollars/euros (depending on your currency settings):

'conditions' => 'Product.price BETWEEN 10 AND 20'

Some guidelines and tips:

  • Always use fully qualified column names (Product.name, not just name).
  • String values (text) need to be enclosed in single quotes ('). Because the condition itself is also enclosed in single quotes, you need to escape the inner quotes using a backslash (\).
  • Check the CakePHP documentation to see how more complex filters should be created.


  • random_product


  • number limit
    • Number of products to show. Default is 1.
  • number columns
    • Optional number of columns to display. Default is 4.
  • string conditions
    • Optional filtering conditions. Default is no filtering.
  • mixed cache
    • true/false or 'key' / 'time': array('key' => 'your_key', 'time' => '+1 day')

Search cloud

This element shows a cloud of recent search queries. The size of the displayed queries vary according to the number of times visitors have searches for them. Use the limit parameter to determine the maximum number of queries to display.


  • search_cloud


  • number limit
    • Number of queries to show, default is 10.
  • mixed cache
    • true/false or 'key' / 'time': array('key' => 'your_key', 'time' => '+1 day')


The RSS element allows you to display content from an RSS-feed directly on your site. You can use this to display news articles, twitter messages, of whatever else is available through an RSS-feed. Specify the source the feed with the url parameter. The optional limit and offset parameters help you manage what gets displayed.

 <?php echo $this->element('rss', array('url' => 'http://news.google.com/news/search?pz=1&cf=all&q=earth'))?>

The layout of the feed is determined by /app/views-default/elements/rss.ctp. If you want to change the layout, copy this file to /app/views/elements and alter it to your needs.


  • rss


  • string url
    • URL of the RSS-feed.
  • number limit
    • Number of items to read from the feed. Note that feeds usually return a limited number of items (10~20). Setting a limit larger than that has no impact.
  • number offset
    • Number of items to skip. For example: setting offset to 5 and limit to 3 will fetch items 5, 6 and 7 from the feed.

Product filter

The product filter element is used to display filtering options in the sidebar next to products. Four blocks of filters are distinguishable: brands, merchants, prices and categories. Each filter type can be disabled with its own switch.


  • product_filter


  • boolean showBrands
    • Show or hide brands filter
  • boolean showCategories
    • Show or hide categories filter
  • boolean showMerchants
    • Show or hide merchants filter
  • boolean showPrices
    • Show or hide prices filter


This example shows all filters; no optional parameters are passed. This is the default behaviour:


This example shows all but the brands filter:

<?=$this->element('product_filter', array('showBrands' => false))?>

This example shows only the categories tree and hides all other filters. This behaviour is similar to pre-1.4.5 installations of DF/Manager:

<?=$this->element('product_filter', array('showBrands' => false, 'showCategories' => false, 'showPrices' => false))?>