This linked code creates a CustomImage type which has a Caption and Location added to the object: http://www.sspaste.com/paste/show/4ed419a088ff7
I want to achieve a number of enhancements and outcomes with this code:
1. When "Add An Image" is clicked in the CMS a window (getCMSFields_forPopup) appears and an image can be uploaded and caption added. When the new image has been saved, and the popup closed I want to have the image automatically added to the page.
2. The Location value specifies where the image is displayed on a page. For example the Location "sidebar" would make the image appear in the sidebar or "below-article" would make the image appear below the article. I want to be able to specify the list of available locations so it relates to the Page type. For example a MapPage might have the locations "above-map" and "below-map" while NewsPage might have "top-right", "bottom-left" and "bottom-right". How do I specify the location options in the getCMSFields_forPopup so they can be set by each Page type?
3. I'd like to make it so a Page can have many CustomImages but only one CustomImage can be "Featured". What is the best way of setting up and controlling this relationship?
4. Currently all of the CustomImages are displayed in the CMS on every single page. Ideally I'd just like to display those CustomImages attached to the Page. If that isn't possible I'd like to sort the table with the attached images at the top.
Thank you in advance.