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.

Can't make {if allow_comments} work properly

July 24, 2010 1:39am

Subscribe [2]
  • #1 / Jul 24, 2010 1:39am

    lamar

    51 posts

    I’m trying to set up my site so that, if Allow Comments is deselected, the entire comment entry form and the “Commenting is not available in this weblog entry” don’t display at all. However, when I surround the comments form with {if allow_comments}, the form disappears even when Allow Comments is selected.

    The odd thing is that I have another site with the same provider, same environment, exactly the same installation of ExpressionEngine, and it works fine.

    Any suggestions?

    ExpressionEngine 1.6.8 (can’t update right at the moment)
    Build 20091002

    Thanks.

    L.

  • #2 / Jul 24, 2010 2:52pm

    Greg Salt

    3988 posts

    Hi Lamar,

    Have you set a specific weblog for your comment form with the weblog parameter?

    Cheers

    Greg

  • #3 / Jul 24, 2010 3:31pm

    lamar

    51 posts

    Yes.

    Here’s the code from the comments part of the template.

    *****

    <div id="comments01">
    
    {exp:comment:entries orderby="date" sort="asc"}
    
    <h5>Comments</h5>
    
    <p>{comment}</p>
    
    <p>{if url == ""}</p>
    
    <p><a href="mailto:{email}">{name}</a> | {location} | {comment_date format="%y%m%d : %H%i"}</p>
    
    <p>{if:else}</p>
    
    <p><a href="http://{url}" target="_blank" rel="noopener">{name}</a> | {location} | {comment_date format="%y%m%d : %H%i"}</p>
    
    <p>{/if}</p>
    
    <p>{/exp:comment:entries}</p>
    
    <p>{if allow_comments}</p>
    
    <p>{exp:comment:form weblog="entries" preview="wc/comments01"}</p>
    
    <h6>Leave a comment</h6>
    
    <p>Name<br />
    <input type="text" name="name" value="{name}" size="50" /></p></p>
    
    <p>E-mail<br />
    <input type="text" name="email" value="{email}" size="50" /></p></p>
    
    <p>Location<br />
    <input type="text" name="location" value="{location}" size="50" /></p></p>
    
    <p>Website<br />
    <input type="text" name="url" value="{url}" size="50" /></p></p>
    
    <p>Comment<br />
    <textarea name="comment" class="commentstextarea01">{comment}</textarea></p></p>
    
    <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</p>
    
    <p>Please enter the word you see in the image below:</p>
    
    <p>{captcha} <input type="text" name="captcha" value="{captcha_word}" maxlength="20" /></p></p>
    
    <p><input class="button01" type="submit" name="submit" value="Submit" /><br />
    <input class="button01" type="submit" name="preview" value="Preview" /></p>
    
    <p>{/exp:comment:form}</p>
    
    <p>{/if}</p>
    
    <p></div>

    *****

    Thanks.

    L.

  • #4 / Jul 24, 2010 5:34pm

    Greg Salt

    3988 posts

    Hi Lamar,

    Do you also have ‘Allow Comments’ checked in the Publish Options tab for this particular weblog entry?

    Cheers

    Greg

  • #5 / Jul 24, 2010 11:51pm

    lamar

    51 posts

    Yes.

    L.

  • #6 / Jul 25, 2010 4:35pm

    Greg Salt

    3988 posts

    Hi Lamar,

    Do you have any access controls set up for this template? Have you got a link to it?

    Cheers

    Greg

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

ExpressionEngine News!

#eecms, #events, #releases