Jump to:

3439 Posts in 1028 Topics by 869 members

Template Questions

SilverStripe Forums » Template Questions » PageComments holder styling (Comments template)

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

Page: 1
Go to End
Author Topic: 2089 Views
  • Tonyair
    Avatar
    Community Member
    81 Posts

    PageComments holder styling (Comments template) Link to this post

    $PageComments generates such code:

    <div id="PageComments_holder" class="typography">

       <h4>Leave Comment</h4>
       
          
             
    <form id="PageCommentInterface_Form_PostCommentForm" action="/stable/home/page-22/iran-pokusali/PageComments/PostCommentForm" method="post" enctype="application/x-www-form-urlencoded">

    ...
    ...
    </form>
    <h4>Comments:</h4>
    ...

    I stylized form with float:right; so form is to the right from comments, but phrase "Leave Comment" placed to the left.
    It looks unlogical, so i'd like to place it to the right - above post form, but "Comments:" will be placed to the right too it's weird and I can't use css selectors there, so i have to modify comments template, but how i can do it?

  • Willr
    Avatar
    Forum Moderator
    5497 Posts

    Re: PageComments holder styling (Comments template) Link to this post

    You can override any templates from core in your our theme. So in this case its the PageCommentInterface.ss template from cms/templates/ that you would want to copy to your theme. You can then edit the file as you wish. Make sure you ?flush=1 after making the change .

  • Tonyair
    Avatar
    Community Member
    81 Posts

    Re: PageComments holder styling (Comments template) Link to this post

    Thx, but what about comments posting form?

  • Willr
    Avatar
    Forum Moderator
    5497 Posts

    Re: PageComments holder styling (Comments template) Link to this post

    Well the actual form code is generated just like every form in SilverStripe. Using the Form.ss template and rendering the individual form fields from the PHP. For customizing the PageComments Form you could try defining a PageCommentInterface_Form.ss template in your theme.

    See this page for more information on how templating a form works. http://doc.silverstripe.org/form#using_a_custom_template.

    2089 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.