Getting Comments going
Posted: 16 May 2008 02:21 PM   [ Ignore ]  
Summer Student
Total Posts:  23
Joined  03-25-2008

Hi everyone. I’m really new to EE, but completely love it. I’ve figured out how to effectively use EE as a CMS, but now I am in need of really expanding into its uses as a blogging tool.

My challenge is that I can’t seem to get commenting to work at all.  I started from scratch with the template, and I’m clueless now as to how to put commenting in as part of a blog entry.  Here is my markup:

{exp:weblog:entries weblog="journal"}

        
<h1>{title}</h1>
        
{body}
                
<span class="technologies">posted by <strong><a href="mailto:{email}">{author}</a></strong>
on {entry_date format="%D, %M %d, %Y"} <a href="/journal/{url_title}">Permalink</a></span>
        

{/exp:weblog:entries}

My question is, how the heck do I get this to allow for people to comment on said “journal” entry? Thank you so very much for your help!

Profile
 
 
Posted: 16 May 2008 02:30 PM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15374
Joined  05-15-2004

shotgunflat, welcome to the forums. Have you taken a look at the Getting started guide and the video tutorials? In your case simply taking a look at some of our templates should help you. They all support blog-style comments out of the box.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 21 May 2008 03:09 PM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  23
Joined  03-25-2008

Anyone interested in rolling up their sleeves and giving me a hand?

Profile
 
 
Posted: 21 May 2008 03:12 PM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15374
Joined  05-15-2004

I can only repeat my advice to take a look at the default templates. They implement comments in a clear and straight way, and are easy to customize.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 21 May 2008 03:17 PM   [ Ignore ]   [ # 4 ]  
Summer Student
Total Posts:  23
Joined  03-25-2008

Thanks—I’m running into some issues with domain.com/comments/entry not pulling weblog data.  I’m really stuck.

Profile
 
 
Posted: 21 May 2008 03:18 PM   [ Ignore ]   [ # 5 ]  
Summer Student
Total Posts:  10
Joined  09-03-2007

By coincidence I’ve just started building comments into my EE site today (site’s been live for a while, but we’re now adding member stuff and comments etc…). Turns out to be dead easy.

The really dumb gotcha I hit was that I hadn’t got the comments module installed, so I was adding comment tags but nothing was happening.

Once I’d got that sorted I just dropped in some quick tags from the Comment Module Tags page in the docs, and I was posting and displaying basic comments in about 2 minutes. Just copy the example code to get started. They go outside your {exp:weblog} tags, btw,  which seems a bit counter-intuitive at first.

Profile
 
 
Posted: 21 May 2008 03:43 PM   [ Ignore ]   [ # 6 ]  
Moderator
Avatar
RankRankRankRank
Total Posts:  1994
Joined  05-07-2007
shotgunflat - 21 May 2008 03:17 PM

Thanks—I’m running into some issues with domain.com/comments/entry not pulling weblog data.  I’m really stuck.

As Ingmar, the default templates, while they my not look as “pretty” as you want them to, contain a vast wealth of knowledge to learn Expression Engine.

So, in the site/comments template, we see the following stripped down code:

{exp:weblog:entries weblog="{my_weblog}" limit="1" disable="member_data|trackbacks"}
    {title}
    {summary}
    {body}
    Posted by {url_or_email_as_author} on {entry_date format
='%m/%d'} at {entry_date format='%h:%i %A'}
{
/exp:weblog:entries}

{exp
:comment:entries weblog="{my_weblog}" limit="25"}
    {comment}
    Posted by {url_or_email_as_author}  
&nbsp;on&nbsp; {comment_date format='%m/%d'} &nbsp;at&nbsp; {comment_date format='%h:%i %A'}
    {paginate}
        
<div class="paginate">
            <
span class="pagecount">Page {current_page} of {total_pages} pages</span>  {pagination_links}
        
</div>
    
{/paginate}
{
/exp:comment:entries}

You get to this from the /site/index template from the following code around line 78

{if allow_comments}
({comment_total}) <a href="{url_title_path="{my_template_group}/comments"}">Comments</a> &#8226;
{/if}

So if we assume that the template group is called “site,” and the url_title of the entry is called “my_entry,” you will be able to see the full article with comments at the following url: http://www.example.com/index.php/site/comments/my_entry

I did not include the add a comment form code in there, and you also need to look at the comment preview template as well.

I hope that helps,

-greg

 Signature 
Profile
MSG
 
 
Posted: 21 May 2008 04:27 PM   [ Ignore ]   [ # 7 ]  
Summer Student
Total Posts:  23
Joined  03-25-2008

Thanks—I’m going to take a break and give this stuff a whirl.

Profile
 
 
Posted: 22 May 2008 03:09 PM   [ Ignore ]   [ # 8 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15374
Joined  05-15-2004

Just to let you know, adding dynamic=“off” fixed the issue.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64928 Total Logged-in Users: 39
Total Topics: 81888 Total Anonymous Users: 27
Total Replies: 440200 Total Guests: 229
Total Posts: 522088    
Members ( View Memberlist )
Newest Members:  agstudioigotthelemonmileswkakiharaAurelsbhairabEric Gunkevovitya.melnikalinm24