had a look at this too
a google search for postcommentform silverstripe
returns http://www.silverstripe.org/archive/show/247213
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.
- Previous 10 entries
- 1
- Page 22(current)
Copy the file /cms/templates/PageCommentInterface.ss to your theme's templates folder, replace:
<% if CanPostComment %>
<h4><% _t('POSTCOM','Post your comment') %></h4>
$PostCommentForm
<% else %>
With the following:
<% if CanPostComment %>
<% control PostCommentForm %>
<h4><% _t('POSTCOM','Post your comment') %></h4>
<% if IncludeFormTag %>
<form $FormAttributes>
<% end_if %>
<% if Message %>
<p id="{$FormName}_error" class="message $MessageType">$Message</p>
<% else %>
<p id="{$FormName}_error" class="message $MessageType" style="display: none"></p>
<% end_if %>
<fieldset>
<legend>$Legend</legend>
<% control Fields %>
$FieldHolder
<% end_control %>
<div class="clear"><!-- --></div>
</fieldset>
<% if Actions %>
<div class="Actions">
<% control Actions %>
$Field
<% end_control %>
</div>
<% end_if %>
<% if IncludeFormTag %>
</form>
<% end_if %>
<% end_control %>
<% else %>
This is essentially pasting the contents of the default Form.ss template into the overridden template inline. You should be able to then make any changes you want to make, including specifying the fields explicitly (see http://doc.silverstripe.org/doku.php?id=form under "Using a custom template" for more information about what that would look like).
That's the best way I can see to do it without modifying system classes. I know this question was asked several months ago, but this is probably a common question, so hopefully it will help someone.
Mark
- Previous 10 entries
- 1
- Page 22(current)