Jump to:

22972 Posts in 11596 Topics by 2824 members

General Questions

SilverStripe Forums » General Questions » Poll module need help

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

Page: 1
Go to End
Author Topic: 787 Views
  • arcticool
    Avatar
    Community Member
    1 Post

    Poll module need help Link to this post

    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>

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Poll module need help Link to this post

    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)

    787 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.