ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Adding a comment submission form

February 07, 2012 11:06am

Subscribe [1]
  • #1 / Feb 07, 2012 11:06am

    meldlc

    2 posts

    I am trying to add a submission form to my blog entries. I have version 1.6.1. I am following the directions in the 1.x User Guide, but no matter what I do, I get a blank screen when I preview my template.

    I’ve tried adding the code to a new template and also to my existing entry page, but nothing.

    I am using this code:

    {exp:comment:form weblog="news" preview="weblog/preview"}
    
    {if logged_out}
    
    Name: <input type="text" name="name" value="{name}" size="50" /></p>
    
    Email: <input type="text" name="email" value="{email}" size="50" /></p>
    
    Location: <input type="text" name="location" value="{location}" size="50" /></p>
    
    URL: <input type="text" name="url" value="{url}" size="50" /></p>
    
    {/if}
    
    <textarea name="comment" cols="70" rows="10">{comment}</textarea></p>
    
    <input type="checkbox" name="save_info" value="yes" {save_info} /> Remember my personal information
    
    <input type="checkbox" name="notify_me" value="yes" {notify_me} /> Notify me of follow-up comments?
    
    {if captcha}
    
    Please enter the word you see in the image below:
    
    {captcha}
    
    <input type="text" name="captcha" value="{captcha_word}" maxlength="20" /></p>
    
    {/if}
    
    <input type="submit" name="submit" value="Submit" />
    <input type="submit" name="preview" value="Preview" />
    
    {/exp:comment:form}

    Changing the weblog name to mine but I am not sure what else I need to change or if I need to put this somewhere different. I assume it needs to be linked somehow to each individual entry but it isn’t clear in the instructions how to do this. I tried adding

    entry_id="{entry_id}"

    but this didn’t change anything. Any point in the right direction would be helpful.

    Thank you!

  • #2 / Feb 14, 2012 2:17pm

    lebisol

    2234 posts

    preview=“weblog/preview”

    So your “preview” template should show the comment using a ‘comment:preview’ tag. Generally it is nice work-flow (but not necessary) that even the preview page offers a comment form so user can re-submit their comment right then and there.

    Please note that ‘comment:form’ and ‘comment:preview’ are two separate tags.

    So structure of ‘submission’ and ‘preview’ page would be:

    {exp:comment:form preview="weblog/preview"}
      {exp:comment:preview}
        here is your comment:{comment}
      {/exp:comment:preview}
    
    if logged in conditions, form fields, avatar etc. 
    
    {/exp:comment:form}

    Post more if needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases