O'Reilly logo

CMS Made Simple 1.6 by Sofia Hauschildt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action—adding random images to the template

Let's add two recently added images from the gallery to the start page of the website.

  1. In the admin console, click on Content | Gallery, and choose the Templates tab.
  2. Click the Create a new template link. Enter Latest as the template name and in the Template Source field add the following Smarty code:
    {foreach from=$images item=image}
    <a href = "{cms_selflink href="photo-gallery"}" title="{$image- >title}"><img src="{$image->thumb}" alt="{$image->title}" />
    </a>
    {/foreach}
    

    You should replace photo-gallery in the example with the alias of the page where the whole image gallery can be found.

  3. Delete everything from the fields Template CSS-stylesheet and Template JavaScript.
  4. Click on Save.
  5. In the admin ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required