Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Custom form entry for discussions

edited October 2008 in Vanilla 1.0 Help
Hey there, I just started using Vanilla, and I've been really happy with how easy it is to customize most of the settings, but I'd really like to alter the form entry for posting comments and discussions. Can anyone point me in the right direction? Ideally I'd like the comment entry be subdivided into several different named fields. thanks!

Comments

  • ok so i've gone through the documentation, and gotten this far:

    i've edited the comment_form.php file to display two textarea elements, here's the code:

    <label for="CommentBox"> <a href="./" id="CommentBoxController" onclick="' ."ToggleCommentBox('".$this->Context->Configuration['WEB_ROOT']."ajax/switch.php', '".$this->Context->GetDefinition('SmallInput')."', '".$this->Context->GetDefinition('BigInput')."', '". $this->Context->Session->GetVariable('SessionPostBackKey', 'string')."'); return false;".'">'.$this->Context->GetDefinition($this->Context->Session->User->Preference('ShowLargeCommentBox')?'SmallInput':'BigInput').'</a>'; $this->CallDelegate('CommentForm_PostCommentToggle'); echo $this->Context->GetDefinition('EnterYourComments').' </label> <textarea name="Body" class="' .($this->Context->Session->User->Preference('ShowLargeCommentBox') ? 'LargeCommentBox' : 'SmallCommentBox') .'" id="CommentBox" rows="10" cols="85"'.$this->CommentFormAttributes.'>' .$Comment->Body .'</textarea> <label for="CommentBox"> <a href="./" id="CommentBoxController" onclick="' ."ToggleCommentBox('".$this->Context->Configuration['WEB_ROOT']."ajax/switch.php', '".$this->Context->GetDefinition('SmallInput')."', '".$this->Context->GetDefinition('BigInput')."', '". $this->Context->Session->GetVariable('SessionPostBackKey', 'string')."'); return false;".'">'.$this->Context->GetDefinition($this->Context->Session->User->Preference('ShowLargeCommentBox')?'SmallInput':'BigInput').'</a>'; $this->CallDelegate('CommentForm_PostCommentToggle'); echo $this->Context->GetDefinition('EnterYourComments').' </label> <textarea name="Body" class="' .($this->Context->Session->User->Preference('ShowLargeCommentBox') ? 'LargeCommentBox' : 'SmallCommentBox') .'" id="CommentBox" rows="10" cols="85"'.$this->CommentFormAttributes.'>' .$Comment->Body .'</textarea>

    This creates two labeled textareas for the comment entry form. I can add variables to language.php to name the fields, but when I hit submit, only the text in the last textarea is submitted. How can I get all textarea's content to be submitted at once?

    thanks,

    Matt
  • You want the textboxes to be appended, or submitted as 2 different things? What will it do once it is submitted, do you then want them to both be stored in the database in custom columns? If you say how you want it to work we can help you better
  • hi, thanks for the response. ideally i'd like 9 labeled text fields to be submitted as the comment form, as opposed to a single text field. once it's submitted, it's alright if all the resultant information is stored as a single comment, but I want to customize the entry process to keep things more organized. i'm trying to build a board to allow businesses to collaborate, and it will help everyone if the information that's entered is more uniform in nature. hope that's more clear. thanks, Matt
This discussion has been closed.