Old Site

This site is archived. I now update and maintain my blog here.

Poll macro source

I've had a few requests for the Poll macro source to be released. I am very busy at the moment, so I am just posting the ascx and associated c# for now. Those of you who wanted a complete package will have to wait a week or so I am afraid.

A couple of things:
- If you modify my code, please send me your changes with an explanation so that I can incorporate any new features/enhancements into my source controlled version.
- If you find any bugs and are unable to fix them, please drop me an e-mail.
- If you use the Poll on a for profit site please consider making a donation using the link at the bottom of the right hand navigation.

To get you started here is how the Macro tag looks for the demo
Question="What does Umbraco need most?"
Responses="More documentation;Database/OS independence;Better Blog extension;Forum extension;Other">

Note: The width property specifies how wide a 100% response bar would be.

You will also need to create a Document type called fmUmbPollResponse with a single property 'Response' that the extension will use to store votes.

As the original post said, this was created as a 20 minute demo project, so don't expect it to be well thought out and 100% stable yet. Obviously any use is entirely at your own risk.

Download from /media/1695/pollsource.zip

Future enhancements:
- Separate layout from code.
- Supply nice default stylesheet
- Add colour list parameter to allow user to specify voting bar appearance.
- Store all responses in a single Umbraco node.


Leave a comment