dotCMS - CORE Starter site

Macros

Macros are simple snippets of code that you can cut and paste into your site to provide a rich set of functionality right out of the box.  Included in this core site is documentation that will help you get started using macros and using them to easily build rich, dynamic web sites. Learn more about commonly used macros here, or visit dotcms.org/macros for a complete listing of macros available in dotCMS.

 


Commonly Used Macros

  • Build RSS from Content

    This macro generates an RSS xml from a content lucene query.

  • Date Formatting
    Use this to show the difference date and time between a string date (before the current date) and the current date.
  • Displaying Resized Images
    This macro will automatically create and display a resized images, with the height and width you specify in the parameters. The macro will create a scaled down image based upon your specified width, height or both. This macro also allows you specify the maximum height and/or maximun width the image could have, and will generate a proportional image that doesn't exceed the values specified.
  • Navigation/Menu Builder
    This macro will build a navigational menu using unordered lists sutiable for standard top or left-hand navigation. These lists can then be formated by css. The resulting code will look like (where the 2nd <li> is the active link).
  • Photo Gallery
    The Photo Gallery "macro" pulls and displays all the photos (jpgs and gifs files) of a given folder, it also pulls and displays sub folders if they contain photos.
  • Pulling Dynamic Lists of Content
    Any content or lists of content in the content database can be pulled and displayed on the front end of your website by using the #pullContent() macro. The macro allows you to specify a query that can be used to generate dynamical lists that can then be formatted and presented to your users.
  • RSS From Dynamic Content List
    This macro generates a RSS xml from a map list. Then name of the keys in the map have to be: 'title' (String - required), 'link' (Identifier - required), 'description' (String - required), 'guid' (Identifier -required), 'pubdate' (Date - optional) and 'author' (String - optional). This macro uses the permalink macro to generate the items link in the RSS.
  • User Comments
    This macro allows you to add a generic comment component to any contentlet in the system. These comments can be either moderated (creates a workflow) or unmoderated.