About Sitellite       Screenshots       Downloads       Forge      Documentation       Community       Support

You are here: Home / Content Collection Code


Content Collection Code

Forum / General / Content Collection Code

Reply         Subscribe         Start new thread         Syndicated Feed (RSS)        

Displaying 1 to 2 of 2 Previous   1   Next
Author Message
visionmark

Posts: 1
Location:
Content Collection Code - Posted: March 26, 2008 - 4:51 PM Quote and reply
I'm working on making some collections, and the only resource I've been able to find is the 5 paged how-to on this website. I was wondering if anyone knew how or where I could find instructions on any of the following customizations:

- including image upload as one of the options (for example, one collection might have name, company, title, phone number, logo) and I would want the logo option to take the user to the same upload form you find when editing web pages.

- Better examples of entering dates. I was able to get year working, but I'd like to get months working, too. I would want them to display as "January, February" in a select, but go into the database as "1, 2".

- How to place and style all this information collected into a page on the website

Back to top View user profile     Contact this member
lux

Posts: 656
Location: Manitoba, Canada
Re: Content Collection Code - Posted: April 2, 2008 - 6:30 AM Quote and reply
visionmark said:
- including image upload as one of the options (for example, one collection might have name, company, title, phone number, logo) and I would want the logo option to take the user to the same upload form you find when editing web pages.


The news app does this using the image chooser instead of just a file upload, which is another option. You would just set the type of that field to 'imagechooser'.

To add an image upload, you would have to create a custom form handler so you could override the default generated add/edit forms for your collection, that way you can specify how to handle the image file (e.g., save it to folder X and rename it based on the ID of the record in the database).

The sitellite_news collection and its add/edit forms are good examples to go on for creating custom form handlers for a collection.

visionmark said:
- Better examples of entering dates. I was able to get year working, but I'd like to get months working, too. I would want them to display as "January, February" in a select, but go into the database as "1, 2".


I typically use a date field in the database to store the dates, which can then use the calendar widget just like this:

[date_field]
type = calendar


If you want separate select boxes for year/month you could also use the regular 'date' widget as well, or use select boxes instead.

visionmark said:
- How to place and style all this information collected into a page on the website


That depends on how you want to display it. Typically I use the saf.Database.Generic package for retrieving objects, since it's aware of Sitellite's permissions and integrates with the multilingual features too. This is described here:

http://www.sitellite.org/index/tutorials-story-action/story.63/title.dynamic-object-generation-with-saf-database-generic

Hope that helps.

Cheers,

Lux

Back to top View user profile     Contact this member
 

Sitellite 5 Beta


Copyright © 2009, SIMIAN systems Inc.
All rights reserved. Privacy policy
Some of the icons on this site were created by the Gnome Project.