10847 Posts in 2516 Topics by 1792 members
|Go to End|
8 July 2011 at 1:41am
Hi, I am using this module, and I think I'm satisfied by it, but is there a way to write my own template for showing the poll?
I couldn't figure it out on my own, so I guess it isn't rly as trivial... or is it?
10 July 2011 at 5:47pm
Well the template is pretty basic - https://github.com/mateusz/silverstripe-polls/blob/master/templates/PollForm.ss. That is trival to customize (just copy to your theme).
However I imagine you want to alter the form html inside that (which comes from $DefaultForm) which is a little tricker to alter. The form already has its own class setup 'PollForm' (https://github.com/mateusz/silverstripe-polls/blob/master/code/PollForm.php) so you just need to define a PollForm.ss template
This documentation page shows how to have a custom form template - http://doc.silverstripe.org/sapphire/en/topics/forms#using-a-custom-template.
12 July 2011 at 2:11am
Thanks, I think I understand what needs to be done and will try it out today/tomorrow.
Thank you, if i have further troubles I will ask again here.
12 July 2011 at 8:43pm
Well tbh I am still not sure where/how to do this.
I have included the wanted template (I hope in full) in the attachment. can someone plz help with including it into pollmodule?
14 July 2011 at 1:50am
Has any1 tried making a custom PollForm.ss?
19 July 2011 at 7:34pm
Could rly use some more help with this.
19 July 2011 at 7:41pm
What you want to do is copy the default 'Form.ss' template (sapphire/templates or on that wiki page) and make a PollForm.ss file in your theme - themes/yourtheme/templates.
You can then customize that PollForm.ss template as you wish, remembering to use ?flush=1 when you view your changes on the site to ensure the templates are refreshed.
Somethings you won't be able to customize (like individual form fields) easily as these come from the PHP files.
20 July 2011 at 12:58am Last edited: 20 July 2011 12:59am
Hey mate, it seems it's not all about PollForm.ss
I was looking at the form for a few days now, trying to make it and I failed, but then I figured it out. It is kinda messy, but you have to change /polls/css/ShowPoll.css if you wish to make anything out of it.
I won't mind if it's a global change (for everything, not only pollform) since it's the detail they want to use.
In any case Willr thank you for helping me, I eventually found where the change needs to be done.
|Go to Top|