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.

Implementing Comments in blog

June 14, 2012 4:12pm

Subscribe [2]
  • #1 / Jun 14, 2012 4:12pm

    wcen

    3 posts

    I can’t seem to implement comments in a blog. They simply don’t show up.

    I tried using the basic code example to no avail:

    {exp:comment:entries sort="asc" limit="20"}
            {comment}
            By {name} on {comment_date format="%Y %m %d"}
    {/exp:comment:entries}

    Do I have to call it with css too? I don’t understand. I just want to be able to stick this code into a template, and allow users to comment on every blog post within a certain channel, such as “news”.

    Thanks!

  • #2 / Jun 16, 2012 2:33pm

    John St-Amand

    865 posts

    Have you put the code inside or outside of your entries loop on your single entry template?

  • #3 / Jun 16, 2012 10:42pm

    wcen

    3 posts

    Have you put the code inside or outside of your entries loop on your single entry template?

    I’m assuming the single entry template is the template that displays only a single post? I have one template displaying every post, truncated up to 200 characters, and a read more link. Upon the user clicking the read more link, a new template called “post-title” is used. I am assuming “post-title” is my single entry template.

    I have the code pasted in the “post-title” template. I tried inserting the code above into the entries channel loop and outside of it, but to no avail. I’m guessing I have some conditions wrong, and am missing some code.

    Here is a snippet from my post-title template:

    {exp:channel:entries channel="{segment_1}" limit="1"}
        <a href="http://{site_url}">Home Page</a> »  
    {if '{segment_3}' != ""}
        <a href="http://{path={segment_1}}">{channel}</a> » 
        {title}
        {if:elseif '{segment_2}' == ""}
        {channel}
        {/if}  
        {/exp:channel:entries}
    
    
    
     {exp:channel:entries channel="{segment_1}" limit="1" dynamic="on"}
                    <h2>{title}</h2>
    <p>                {news_body}</p>
    
    <p> <br />
      {exp:comment:entries sort="asc" limit="20"}<br />
            {comment}<br />
            By {name} on {comment_date format="%Y %m %d"}<br />
      {/exp:comment:entries}  </p>
    
    
    
    <p> {/exp:channel:entries}

    I don’t have code to display a form either.

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

ExpressionEngine News!

#eecms, #events, #releases