Results 1 to 3 of 3

Thread: How can i tweak the comment form ?

  1. #1

    Default How can i tweak the comment form ?

    Hello,

    I need to tweak the code of the comment form to add placeholders to the input and textarea tags.
    How can i do this ?

    Thanks
    Utilisateur de Contao depuis 2008

  2. #2
    Experienced user
    Join Date
    08-21-09.
    Posts
    563

    Default Re: How can i tweak the comment form ?

    Hey, try this. Haven't tried it, but the docs say this should work. You've probably found where the form fields are in the template, each field looks something like this:

    Code:
    <?php echo $this->fields['name']->generateLabel(); ?>             // For the label
    <?php echo $this->fields['name']->generateWithError(true); ?> // For the input
    Right before that, add this line (for each, making sure to change ['name'] accordingly):

    Code:
    <?php $this->fields['name']->placeholder = 'Something Goes Here'; ?>
    It looks like most/all of the input attributes and events are supported by doing this.
    Brian

  3. #3

    Default Re: How can i tweak the comment form ?

    Thanks Brian, it works perfectly 8-)
    Utilisateur de Contao depuis 2008

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •