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 display comments

February 23, 2011 12:38pm

Subscribe [3]
  • #1 / Feb 23, 2011 12:38pm

    Castlegate IT

    25 posts

    Hi

    I’m building a site based on EE v1.6.8. I enabled comments and inserted a code snippet to display them for a specific entry. (I’m using a plugin called Structure to organise the pages. Structure uses different url_titles from EE, therefore I always have to show comments using page_id)

    The code I’m trying to use is the following:

    {if logged_in}
    {exp:comment:entries entry_id="589" weblog="page"}
    {if no_entries}
    test
    {/if}
    {/exp:comment:entries}
    {/if}

    I also tried it the way the author of Structure suggests it in the documentation.

    {exp:comment:entries entry_id="589" parse="inward"}
    {if no_entries}
    test
    {/if}
    {/exp:comment:entries}

    I tried these code snippets inside the weblog tag and outside any EE tags as the documentation suggests.

    All I get is “M30o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr”

    I’d appreciate any help. Thanks.

  • #2 / Feb 24, 2011 4:03am

    John Henry Donovan

    12339 posts

    Semlyen IT,

    {if no_entries} is not a tag. Checkout {if no_results} in our docs.

    Structure has specific docs for comments in EE too. Try what they suggest

    I tried these code snippets inside the weblog tag and outside any EE tags as the documentation suggests.

    Always have them outside

  • #3 / Feb 24, 2011 6:34am

    Castlegate IT

    25 posts

    Thanks for the reply.

    I realise that no_entries is not a tag, I wrote that in error whilst quickly writing this post.

    Perhaps I should have included more details.

    I’ve tried the examples in the EEv1 documentation and also the examples provided by the structure plugin author, both produce the same results. From my research I believe the problem may be to do with template parsing?

    It does not matter what code or tags are placed within the comment tag, whether its a simple “hello world” or whatever, we allways get the same output:

    M30o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr

    Even when using the most basic of examples:

    {exp:comment:entries entry_id="589" parse="inward"}{/exp:comment:entries}

    or

    {exp:comment:entries entry_id="589" parse="inward"}Hello world{/exp:comment:entries}

    The same problem also happens with the comment form tag too.

    Any ideas or suggestions would be great. Thanks for your time

  • #4 / Feb 24, 2011 4:23pm

    Ingmar

    29245 posts

    Can you show us a little more of your code? Are you using related entries? I would also suggest upgrading to EE 1.7., quite a few bugfixes there.

  • #5 / Feb 25, 2011 11:49am

    Castlegate IT

    25 posts

    I tried updating to the latest version on a clone of the live site, and this broke a hell of a lot of things. However i was able to test the comments and I still get them same odd output.

    Heres what I get again, where ever i insert the comment tags: “M40o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr”

    Heres a template from the blog section of the site: (i removed a few snippets of pure html so google does not pick them up)

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html >
    <head>
    {if last_segment_np == "blog"}
        <title><!-- removed --></title>
    <!-- removed -->
    {if:else}
        {if segment_2 == "category"}
            {exp:weblog:categories weblog="meandmybike" style="linear" show_empty="no"}
                {if segment_3 == category_url_title}
        <title>{category_name} | <!-- removed --></title>
    <!-- removed -->
        {/if}   
            {/exp:weblog:categories}
        {if:else}
            {exp:weblog:entries weblog="meandmybike"}
                {if last_segment_np == url_title}
        <title>{if seotitle != 0}{seotitle}{if:else}{title}{/if} | Me and My Bike | Cycling City York</title>
    <!-- removed -->
                {/if}
            {/exp:weblog:entries}
        {/if}
    {/if}
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    {embed="subpages/.head"}
    </head>
    <body>
    <div id="wrap">
    {embed="subpages/.header" seoh1="{if seoh1!= 0}{seoh1}{if:else}{title}{/if}"}
        <div id="content">
            <div id="leftCol">
        {embed="subpages/.left" url="{if segment_1 != ""}{segment_1}/{/if}{if segment_2 != ""}{segment_2}/{/if}{if segment_3 != ""}{segment_3}/{/if}{if segment_4 != ""}{segment_4}/{/if}{if segment_5 != ""}{segment_5}/{/if}"}
                <div id="centerCol">
                    <div id="meAndMyBike">
    
    {exp:weblog:categories weblog="meandmybike" style="linear" show_empty="no"}
        {if segment_2 == "category" AND segment_3 == category_url_title}<h3 id="blogCategoryTitle">{category_name}</h3>{/if}
        {if no_results}
            {redirect="404"}
        {/if}   
    {/exp:weblog:categories}
    
    {if last_segment_np == "blog"}
        <h2>Latest Articles</h2>
    <p>{/if}</p>
    
    <p>{exp:weblog:entries orderby="date" weblog="meandmybike" limit="4" paginate="bottom"}<br />
                        <div class="itemMe"><br />
        {if last_segment_np == url_title}<br />
            </p><h3>{title}</h3>
    <p>        {content}<br />
        {if:else}<br />
            </p><h3><a href="http://{title_permalink=">{title}</a></h3>
    <p>        {if summary == ""}{exp:md_eexcerpt if_exceeds="130" stop_after="150" append="…"}{content}{/exp:md_eexcerpt}{if:else}{summary}{/if}<br />
        {/if}</p>
    
    <p>    <strong>Posted {entry_date format="%d/%m/%Y"}</strong><br />
        <div class="clear"></div></p>
    
    <p>    {if segment_2 != url_title}<br />
            {paginate}<br />
            {if previous_page}<br />
                <a href="http://{auto_path}">« Previous</a><br />
            {/if}<br />
            {if "{total_pages}" != 1}Page {current_page} of {total_pages}{/if}<br />
            {if next_page}<br />
                <a href="http://{auto_path}">Next »</a><br />
            {/if}<br />
            <div class="clear"></div><br />
            {/paginate}<br />
        {/if}<br />
        <br />
        {!-- 404 invalid url_titles --}<br />
        {if last_segment_np != "blog"}<br />
            {if total_results != 1 AND segment_2 != "category"}<br />
                {redirect="404"}<br />
            {/if}<br />
            {if url_title == segment_2 AND segment_3 != ""}<br />
                {redirect="404"}<br />
            {/if}<br />
        {/if}<br />
        <br />
        {!-- 404 invalid categories --}<br />
        {if segment_2 == "category" AND segment_3 == ""}<br />
            {redirect="404"}<br />
        {/if}</p>
    
    <p>    {!-- 404 Extra segments --}<br />
        {if segment_4 != ""}<br />
            {redirect="404"}<br />
        {/if}<br />
                        </div><br />
    {/exp:weblog:entries}<br />
    {exp:comment:entries sort="asc" limit="20"}</p>
    
    <p>{comment}</p>
    
    <p>By {name} on {comment_date format="%Y %m %d"}<br />
    {if no_results}<br />
     no results<br />
    {/if}<br />
    {/exp:comment:entries}</p>
    
    <p>{embed="subpages/emailAFriend" url="{if segment_1 != ""}{segment_1}/{/if}{if segment_2 != ""}{segment_2}/{/if}{if segment_3 != ""}{segment_3}/{/if}{if segment_4 != ""}{segment_4}/{/if}{if segment_5 != ""}{segment_5}/{/if}"}<br />
    {embed="subpages/tellUs" url="{if segment_1 != ""}{segment_1}/{/if}{if segment_2 != ""}{segment_2}/{/if}{if segment_3 != ""}{segment_3}/{/if}{if segment_4 != ""}{segment_4}/{/if}{if segment_5 != ""}{segment_5}/{/if}"}<br />
                    </div><br />
                </div><!--end center Col--><br />
            </div><!--end leftcol--><br />
    {exp:weblog:entries orderby="date" weblog="meandmybike" limit="1"}<br />
        {embed="subpages/.right" f1="{function1}" f2="{function2}" f3="{function3}" f4="{function4}" entry="{entry_id}"}<br />
        {if no_results}<br />
            {embed="subpages/.right" f1="(None)" f2="(None)" f3="(None)" f4="(None)" entry=""}<br />
        {/if}<br />
    {/exp:weblog:entries}<br />
        </div><!--end content--></p>
    
    <p>{embed="subpages/.footer" id="" url="{if segment_1 != ""}{segment_1}/{/if}{if segment_2 != ""}{segment_2}/{/if}{if segment_3 != ""}{segment_3}/{/if}{if segment_4 != ""}{segment_4}/{/if}{if segment_5 != ""}{segment_5}/{/if}"}<br />
    </div><!--end wrap--><br />
    <!-- removed --><br />
    </body><br />
    </html>

  • #6 / Feb 25, 2011 4:09pm

    Sue Crocker

    26054 posts

    Hi, Semlyen IT.

    Typically, comments are on a single entry template. It doesn’t appear to be the case here…

  • #7 / Feb 28, 2011 6:34am

    Castlegate IT

    25 posts

    Your right, and I should be using the example from the structure plugin website for this particular template.

    I’ve tried the standard comments tag on a single entry page and that produces the same result anyway.

  • #8 / Feb 28, 2011 4:52pm

    Ingmar

    29245 posts

    Can you show us the code you used on the new template? Try to keep the test template as minimal as possible. You might also want to consider upgrading to 1.7. It’s probably unrelated, but a recommended update.

  • #9 / Mar 01, 2011 9:32am

    Castlegate IT

    25 posts

    Thanks for all the help so far, I’ve been a bit rushed and I don’t think I’ve really been helping myself with this much by not giving you much to go on.

    Regarding the update, I did clone my site and run the update, it caused some problems for me that I was unable to solve and also did not resolve the issue with the comments. So I dont think this will help.

    I’ve created a basic template which shows a single entry, using the standard /templategroup/index/url_title url to be safe (removing stucture completely for now)

    The results are still the same. Most puzzling. Here is the template code:

    Again its just outputting M10o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr and M20o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr where the comment tags are. My weblog entry is showing as expected.

    I’ve dont a bit of research and this is some sort of parsing issue? Strange if you Google “M10o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr” there are some EE powered sites in the results which seem to be suffering from the same problem.

    {exp:weblog:entries orderby="date" weblog="meandmybike" limit="4" paginate="bottom"}
        <h3>{title}</h3>
    <p>    {content}<br />
        <strong>Posted {entry_date format="%d/%m/%Y"}</strong><br />
    {/exp:weblog:entries}</p>
    
    <h3>Comments</h3>
    <p>{exp:comment:entries sort="asc" limit="20"}<br />
        {comment}<br />
        By {name} on {comment_date format="%Y %m %d"}<br />
    {/exp:comment:entries}</p>
    
    <h3>Comment Form</h3>
    <p>{exp:comment:form weblog="meandmybike"}<br />
         {if logged_out}<br />
             Name: <input type="text" name="name" value="{name}" size="50" /></p><br />
             Email: <input type="text" name="email" value="{email}" size="50" /></p><br />
             Location: <input type="text" name="location" value="{location}" size="50" /></p><br />
             URL: <input type="text" name="url" value="{url}" size="50" /></p><br />
         {/if}</p>
    
    <p>     <textarea name="comment" cols="70" rows="10">{comment}</textarea></p><br />
         <input type="checkbox" name="save_info" value="yes" {save_info} /> Remember my personal information<br />
         <input type="checkbox" name="notify_me" value="yes" {notify_me} /> Notify me of follow-up comments?<br />
         {if captcha}<br />
             Please enter the word you see in the image below:<br />
             {captcha}</p>
    
    <p>         <input type="text" name="captcha" value="{captcha_word}" maxlength="20" /></p><br />
         {/if}</p>
    
    <p>     <input type="submit" name="submit" value="Submit" /><br />
         <input type="submit" name="preview" value="Preview" /></p>
    
    <p>{/exp:comment:form}

  • #10 / Mar 01, 2011 10:17am

    Castlegate IT

    25 posts

    Just a quick update.

    I cloned the entire website again and tried the update. Still the same result. I also disabled every module, plugin and extension but nothing worked.

    My client is expecting comments by the 10th and im starting to thing I’m going to have to write my own custom system to achieve it lol.

    Any suggestions?

  • #11 / Mar 02, 2011 9:00am

    John Henry Donovan

    12339 posts

    Semlyen IT,

    On your test single entry page just add the following presuming your URL looks like this
    http://www.mydomain.com/index.php/template_group/template/url_title

    {exp:weblog:entries  weblog="meandmybike" limit="1" url_title="{segment_3}"}
        <h3>{title}</h3>
    <p>    {content}<br />
        <strong>Posted {entry_date format="%d/%m/%Y"}</strong><br />
    {/exp:weblog:entries}</p>
    
    <h3>Comments</h3>
    <p>{exp:comment:entries weblog="meandmybike" sort="asc" limit="20" url_title="{segment_3}"}<br />
        {comment}<br />
        By {name} on {comment_date format="%Y %m %d"}<br />
    {/exp:comment:entries}

    Can you then proved us with a link to that page please. Only add the above and nothing else

  • #12 / Mar 02, 2011 9:13am

    Castlegate IT

    25 posts

    Thanks again for the reply.

    I copied your example exactly and here is the result (same as before):

    http://ccy.loge.co.uk/index.php/tt/index/my-favourite-cycle-route/

  • #13 / Mar 03, 2011 1:38am

    John Henry Donovan

    12339 posts

    Semlyen IT,

    Ok that should not be happening. The only clue as to why it was happening if you were using snippets, embeds or otherwise but you have added the code directly to that template?

    Please check your email

  • #14 / Mar 03, 2011 7:25am

    Castlegate IT

    25 posts

    Yea thats correct, i was using a single template for that.

    I’ve cloned the website again to the latest version of the live site, details of which have been sent via the login request.

    Thanks for the help!

  • #15 / Mar 03, 2011 11:33am

    Sue Crocker

    26054 posts

    Hi, Semlyen. In all your 400 plus entries, you only have one entry that is open and that allows comments. I suggested adding one more and specifically testing with that entry. Does that help?

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

ExpressionEngine News!

#eecms, #events, #releases