Monday 05 September 2005 12:19:06 am
Hi there, me again... I have been searching the forums for the answer to this question but so far I've had very little luck implementing this. The website I am developing has a unique home page as opposed to the normal content pages, simply I have set up a pagelayout.tpl override and created a new template that lets me make my home page layout function correctly. On the home page I have a couple of specific things I need to accomplish, this is what I need: - 1. I need to have a block wherein I can display a current promotion for a particular product or special event. 2. I need a block wherein I can display the most recent (or a selected) article from either the news section or sponsorship section (both sections use fairly straight forward article classes). 3. The remainder of the page is made up of a large static introduction image and some static links, these elements are basically hard coded into the template as they have no need to be dynamic. The home page may have a small amount of text within it but at this stage there is no text needed. The promo block will need to be updateable, essentially I need to be able to add a new promotion whenever there is a need, also there will only ever be one promotion displayed at a time. However when a promotion is added I would like it to remain in the system so if it should need to be re-run it does not have to be re-created, in other words we don't want to delete promotions. What I have looked at doing seems to be a simple way to do this but I'm not sure how to make it work. I have created a new folder inside the media folder and called it Promotions, and then I created a new content class and named it promo. The promo class contains a title, an XMLfield and a related object for images (this may not be needed as I may control the image via CSS). My home page is the root node (ID 2) and because my home page needs very little textural content there is no need to use the XMLfields to add content, therefore I don't want to embed the promo class within the XMLfield. What I would like to do is call the promo from the template. This would mean that when a new promo is run I can simply swap the old promo object relation with the new promo object relation. I hope that makes sense so far? The reason it becomes difficult to embed the promo object via the XMLfield of the folder class is simply due to the amount of static content within my home page template, the promo would in that case be called via the page_mainarea.tpl thus putting the promo block smack bang in the middle of any content there may be at a later date and in turn breaking my layout. Calling the promo from the template using a specific object ID is also made difficult due to the idea of keeping past promo's in the system. What I need to do is call the object relation with some other method that does not rely on the object ID, but I'm not sure how? I know that was long winded but I think its worth trying to make my goals clear that way I may get a clear answer ;). I'll leave it at that for now, I have a couple of other questions regarding the article block but they can wait for time being. So if you are still with me and you have any suggestions for how to make this work I would greatly appreciate any input. There's a good chance I may be going about this the wrong way so if you feel that is the case please don't hesitate to correct me. If you still have no idea what I'm on about I'll do my best to elaborate. Thankyou for listening.
Pardon me while I burst into flames...
|