Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Poll module need help


Reply


2 Posts   885 Views

Avatar
arcticool

Community Member, 1 Post

14 June 2009 at 9:30am

I'm trying to update the below code

<li class="even val2"><input id="ShowPoll_MyPoll_PollAnswer_2" name="PollAnswer" type="radio" value="2" class="radio" /> <label for="ShowPoll_MyPoll_PollAnswer_2">This is label 1</label></li>

to

<li class="even val2"><label for="ShowPoll_MyPoll_PollAnswer_2"><input id="ShowPoll_MyPoll_PollAnswer_2" name="PollAnswer" type="radio" value="2" class="radio" /> This is label 1</label></li>

I can't understand which php file or css is generating the below data .

\polls\templates\includes\showpoll.ss

<fieldset>
      <legend></legend>
      <% control Fields %>
      
         $FieldHolder
      <% end_control %>
      <div class="clear"><!-- --></div>
   </fieldset>

Avatar
Willr

Forum Moderator, 5513 Posts

14 June 2009 at 9:46pm

Edited: 14/06/2009 9:48pm

I think the code you want to change is in CheckboxSetField.php in the function Field(). Sadly the existing formfields are all generated from the PHP rather then template files so it makes it a bit of a mission to change that 1 thing. Ideally all the html should be stripped out into templates. Hopefully we can make this happen if the form improvements for 2.4 go ahead.

Any reason why you need to change it? might be easier to just use CSS. (messy I know) but its that or you edit the CheckboxSetField field function (you could try and decorate the function)