Polling Plugin for Typo II... 2
I am continuing to work on the polling stuff for Typo. I've ended up expanding my approach to include a full Admin panel for the Polls. Mostly to allow selection of the "active" sidebar poll and to be able to view historical poll results.
I've run into an issue with the sidebar poll content.rhtml though. I was wanting to have AJAX voting via remote_link_to's, but no public routing is defined for sidebar plugins.
I've looked into how TextFilters are implemented in Typo to better understand how they work despite not having public routing. The TextFilterController defines a public_action method that allows child filters to include symbols for :plugin_public_action which in turn exposes the referenced methods.
Despite being named plugin_public_action it is in fact only implemeted for Filters and not for Sidebar components. I am debating adding this functionality and submitting a patch, however, I wonder if I am the only person that needs this functionality? I would update the routes.rb file to include a route for my poll controller, but that doesn't work because the sidebar controller handles loading all of the dependencies for "child" plugins.
Update: I just re-read this post and it comes off a bit badly. Mostly because I wrote it at the end of a very long day. I apologize to the reader for the stream of consciousness quality of the posting.
I've run into an issue with the sidebar poll content.rhtml though. I was wanting to have AJAX voting via remote_link_to's, but no public routing is defined for sidebar plugins.
I've looked into how TextFilters are implemented in Typo to better understand how they work despite not having public routing. The TextFilterController defines a public_action method that allows child filters to include symbols for :plugin_public_action which in turn exposes the referenced methods.
Despite being named plugin_public_action it is in fact only implemeted for Filters and not for Sidebar components. I am debating adding this functionality and submitting a patch, however, I wonder if I am the only person that needs this functionality? I would update the routes.rb file to include a route for my poll controller, but that doesn't work because the sidebar controller handles loading all of the dependencies for "child" plugins.
Update: I just re-read this post and it comes off a bit badly. Mostly because I wrote it at the end of a very long day. I apologize to the reader for the stream of consciousness quality of the posting.
Trackbacks
Use the following link to trackback from your own site:
http://www.stevelongdo.com/articles/trackback/60
Comments
-
Steve: How's the polling plugin going? Strangely, I was also thinking about adding this, I need it for my podcast, and using textfilters seemed very promising. I also thought along the lines of making Poll model similar to a Comment, or even make a Poll part of the comment. Anyway, I don't have time to work on this now, and I'd love to use anything working... Do you have anything working now?
-
I will be posting an update probably this weekend with progress and perhaps my first live poll (fingers crossed). I am in the process of adding some features right now that probably are less important than getting the polls to render in the sidebar, but I am sick of fighting that particular issue right now. I have added admin code that I am not sure if I can package as part of a plugin, I need to research this a bit more before I can release anything "officially" though.