Hey. I'm looking for a quick pointer. I want a carousel of images on the front page of a site that could contain X items - an image, text link and url for each item. I want the user to be able to customise how many items and add the content for each, from a tab on the front page.
So at the moment I have a hardwired amount of items in the HomePage class:
$fields->addFieldToTab('Root.Content.Carousel', new TextField('TitleOne','1. Title'));
$fields->addFieldToTab("Root.Content.Carousel", new TextField('HoverTextOne', '1. Hover Text'));
$fields->addFieldToTab('Root.Content.Carousel', new TreeDropdownField("LinkOneID", "1. Link","SiteTree"));
$fields->addFieldToTab("Root.Content.Carousel", new ImageField('ImageOne', '1. Carousel Image'));
$fields->addFieldToTab('Root.Content.Carousel', new TextField('TitleTwo','2. Title'));
$fields->addFieldToTab("Root.Content.Carousel", new TextField('HoverTextTwo', '2. Hover Text'));
$fields->addFieldToTab('Root.Content.Carousel', new TreeDropdownField("LinkTwoID", "2. Link","SiteTree"));
$fields->addFieldToTab("Root.Content.Carousel", new ImageField('ImageTwo', '2. Carousel Image'));
... etc
This works OK, but it's ugly and limiting. The ideal solution would be an "add another" button, and a remove button. But I've no idea where to start. Am I missing something fundamental like a nice module or something?
Thanks