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?
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
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.
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.
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?
Has any1 tried making a custom PollForm.ss?
Could rly use some more help with this.
bump
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.
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 still don't know where to change one thing : radio buttons (or checkboxes) . I have my own box (class "radio") with a bit of javascript that I have to implement, but tbh don't know where to do 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.