I have a teaser section on many pages, including 4 teaser boxes next to each other. There will be many different teaser boxes and the editor of the site should be able to select in the backend which teaser boxes should be shown in the frontend.
I had the idea to create the teaser boxes as template files in the Includes Folder. Then somehow make the names of the teaser ss.Files selectable via checkboxes in the backend for each Page. Then I would need some logic to check which teaser boxes should be shown. But the most important thing is to know how I can add includes dynamically in the template.
Is this a general good idea or should I try to write widgets?
there should be actually different types of teaser boxes. one box contains news managed via the cms, other boxes contain swfs or images.
now I try this: every teaser has a type set in the backend. Then the frontend checks for the type:
<% control Teaser %>
<% if TeaserType = News %>
<% include NewsTeaser %>
<% else %>
<% end_if %>
<% end_control %>
the only problem then is that the NewsTeaser is not getting its data anymore. I think this is because NewsTeaser is included in a control. Including the NewsTeaser after the control works fine and the News are shown correctly. I know to use $Top to access variables at top level. But this does not work in a control like <% control Top.News %>. MMh.