1776 Posts in 498 Topics by 533 members
Blog Module
SilverStripe Forums » Blog Module » Customising the Comment Form HTML
Discuss the Blog Module.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
| Go to End | ||
| Author | Topic: | 5132 Views |
-
Re: Customising the Comment Form HTML

22 July 2009 at 2:38pm
had a look at this too
a google search for postcommentform silverstripe
returns http://www.silverstripe.org/archive/show/247213 -
Re: Customising the Comment Form HTML

11 December 2009 at 4:51am Last edited: 11 December 2009 4:53am
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
| 5132 Views | ||
| Go to Top |

