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
<?UMBRACO_MACRO
macroAlias="Poll"
Width="350"
ResponseStoreNodeId="1201"
Question="What does Umbraco need most?"
Responses="More documentation;Database/OS independence;Better Blog extension;Forum extension;Other">
</?UMBRACO_MACRO>
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.
Hi,
Please send me the poll source code.
I am new in Umbraco and try to learn it better by viewing some nice code.
Regards,
Tuesday, July 18, 2006@9:19 AM
Oops! I hadn't read the last line.
I thought it is a contact us form :-D
Tuesday, July 18, 2006@9:26 AM
The link is just above your first comment!
Thanks.
D.
Tuesday, July 18, 2006@9:36 AM
Hello,
thanks for your helpful code it works without any problem .but i have a bug with it.
when i click on "vote" button i see results 2 times in my Response Store page
would you please help me about it?
Thanks,
Monday, December 25, 2006@4:53 AM