Jump to:

3447 Posts in 1032 Topics by 872 members

Template Questions

SilverStripe Forums » Template Questions » Reusable Template with Slideshow Banner - where to start?

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1129 Views
  • vwd
    Community Member
    158 Posts

    Reusable Template with Slideshow Banner - where to start? Link to this post


    I'm a SS newbie, and I'm attempting converting an existing static site template into SS. I use this template regularly for new projects, I would like to create a reusable template. One particular component of the the template I'm trying to implement now in my SS template is an image banner (basically, an image slideshow).

    My challenge is not with the slideshow part (for which I will use jQuery cycle - I don't necessarily want to specify this at this stage), but to create an easy way for the content editor/theme designer to select the images to go into the slideshow banner (ie. insert a list of <img>'s on the page)


    • Each page on the site will have its unique set of images (for the banner)
    • Provide a means in the CMS admin area to specify the images to be used for each page (either providing a reference to an ImageGallery or explicitly listing the images)
    • The template needs to be modular (obviously) and reusable

    Where do I start!!? I don't think I need to create a 'module'. It seems like something I could implement partially in the controller & the template? If so - could someone please point me to a tutorial, reference or example that I can work from please?

    Many thanks in advance for any pointers...


  • Willr
    Forum Moderator
    5511 Posts

    Re: Reusable Template with Slideshow Banner - where to start? Link to this post

    ... where to start..

    You're right, you probably don't need a whole module to do this (although there are a few modules which do image galleries) but you will probably
    want to make a custom Page type for your slideshow page. Tutorial 2 covers how to make page types.

    By using a page type for your slideshow you can also give it a custom template (with your slideshow html) and also include your javascript file using <% require %>.

    For the backend the easiest option would be to link a folder to your page type using a has_one relationship. Then you can get all the files from inside the folder to use as your gallery using the ORM.


  • vwd
    Community Member
    158 Posts

    Re: Reusable Template with Slideshow Banner - where to start? Link to this post

    Willr, thank you for taking the time to point me in the right direction.

    I really appreciate it.

    Will look into your suggestions.

    Thank you.


Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.