FORUMS CLOSED DUE TO SPAM. YOU STILL CAN ADD POST!

displaying/not displaying comments and form

Feed 4 posts, 2 voices

Avatar
19 posts

I am using a single layout for multiple pages. I put the following code in the layout:

<div class="generic right_column end">
<p class="intro drop bigger"><?php echo $this->content('body'); ?><span class="redstop">.</span></p>
<?php
    if (Plugins::isEnabled('comment'))
    {
        if ($this->comment_status != Comment::NONE)
            $this->includeSnippet('comment-each');
        if ($this->comment_status == Comment::OPEN)
            $this->includeSnippet('comment-form');
    }
?>
</div> <!-- end .right column -->

This doesn’t display comments or comment form even when I’ve got “Comments: open”. It also eliminates my footer (which makes me think something has not been closed, but don’t know what).

I want to display comments and form when I’ve chosen “open” and I want nothing displayed when I’ve chosen “none.”

 
Avatar
1493 posts

Hi Phil: A simple problem, now fixed in SVN at r445. What you want to do is change

    if (Plugins::isEnabled('comment'))

to

    if (Plugin::isEnabled('comment'))

(no “s” on “Plugin”) and that should do it.

 
Avatar
19 posts

Thanks a bunch David. Worked perfect. But even when I have “Comments: none”, it still displays “0 comments”. Any way to eliminate that as well for “none”?

 
Avatar
1493 posts

Hmmm… I can’t replicate that, Phil. Even saving a page as “open”, and then re-saving with comment status as “none” — it all behaves properly. You have saved the page(s) in question with “Comments -none-” underneath the editing area?

I assume this is with 0.9.5…? Puzzled!

 
Avatar
19 posts

scratch that. works fine. too much multi-tasking made me careless.

Thanks for being so quick David.