Here is what I'm after:
My site's homepage uses JQuery to cycle through a set of banners. Each banner has a title, text, image and a link to another page within the site.
I've found two ways of doing this. The first is to add all the fields to the homepage, e.g. make a tab called Banner 1 with the four necessary fields, and repeat (Banner 2, 3, etc.). But, if I do it this way I'm limited to a set number of banners (and HomePage.php gets too messy for my liking).
What I really need is the ability to add as many banners as I want. My second approach allows this but I'm not sure if it is considered correct. Basically I've created a banner holder and a banner page. Both page types have a redirect to stop them from being visited directly:
public function init() {
parent::init();
Director::redirect(Director::baseURL());
}
I then use a control, e.g. <% control FeatureBanners %> to display them on the homepage.
Is this the best way to achieve what I'm after? Any suggestions or a better solution would be greatly appreciated.
I also couldn't get redirectPerm to work, which I'm guessing is better than redirect in this case.
Thanks.