Page 1 of 1
comments under the article on the main page
Posted: Sun Apr 29, 2007 4:04 pm
by stifler
hey guys,
a question i couldnt figure out with the search in this forum.
what I wanted to have, is that all the comments (i dont have that many) show up under the article on the main page. so the index page looks like this:
article
comment1
comment2
article2
comment1
comment2
is this possible without hacking 2 much in the code? any ideas?
thank you!
Re: comments under the article on the main page
Posted: Sun Apr 29, 2007 7:27 pm
by garvinhicking
Hi!
If you search this forum for "comments" and "overview" you can get this entry:
http://board.s9y.org/viewtopic.php?t=82 ... s+overview
The way to go would be to edit your entries.tpl template file like I pointed out there. Maybe you can try if that works for you?
HTH,
Garvin
Posted: Tue May 01, 2007 4:11 pm
by stifler
what I thought of I found exactly in another blog:
http://www.drekhead.com/.
When u click on the
(inline zeigen) next to the comments, the comments pop up similar to the image-lightbox. Do u guys think such a feature is possible to program? I think it would be nice to have for a lot of blogs.
if somebody has an idea how to tackle this? my programming skills are way to bad for such a thing.
Posted: Tue May 01, 2007 4:51 pm
by judebert
We already have an option like that for popup comments. If you enable popups in your configuration, comments will pop up in a new window when you click the comment link.
Making it scroll outwards like the blog you pointed to would require Javascript. Not a terrible thing, but not something I've got time for.
With the lightbox plugin, you could just modify the entries.tpl, remove the "onclick" attribute, and add the appropriate "rel" or "class" attribute (depending on which of the *boxes you're using). Then lightbox overlay it on the screen for you. (You might need to select lightbox+ or greybox; I don't think lightbox does anything but images.)
Posted: Tue May 01, 2007 5:26 pm
by stifler
thanks for the reply. perhaps one day somebody will program it. meanwhile i use the popup
thanks!
Displaying Comments
Posted: Mon May 21, 2007 12:24 am
by wtjoker
I tried editing the entries.tpl, removing the if check as suggested. I still am not seeing the comments underneath, I have to click on the comments link to see them. Am I missing something ?
Thanks
Mark
Posted: Mon May 21, 2007 9:13 am
by stifler
@wtjoker: did u get the comments into the lightbox?
Posted: Mon May 21, 2007 5:24 pm
by wtjoker
I cannot get the lightbox to work on the brownbag style. No matter what option I choose it makes no difference.
Posted: Mon May 21, 2007 10:17 pm
by judebert
You're not missing anything. It should work. Which template are you using (BrownBag, I assume)? Did you edit the entries.tpl in that directory? I you accidentally edited the one in templates_c/, it wouldn't work. If you edited the one in default/, it wouldn't work unless your template didn't have one of its own.
To know more, we'd need a URL, or possibly the modified entries.tpl.
Posted: Tue May 22, 2007 2:57 am
by wtjoker
Thanks for the reply.
http://www.shinerbock.com
Here is the code I am editing in the entries.tpl in the /www/templates/brownbag/ dir.
{/foreach}
</span>
{/if}
<div class="serendipity_entry_body">
{$entry.body}
</div>
{if $entry.is_extended} (removed)
<div class="serendipity_entry_extended"><a id="extended"></a>{$entry.extended}</div>
{/if} (removed)
{if $entry.has_extended and not $is_single_entry and not $entry.is_extended}
<br /><a href="{$entry.link}#extended">{$CONST.VIEW_EXTENDED_ENTRY|@sprintf:$entry.title}</a><br /><br />
{/if}
Posted: Tue May 22, 2007 5:47 pm
by judebert
I went to your site and examined the source. First, note that the editing marked here won't cause comments to be displayed, but entries' extended bodies.
But it's not working anyway. If this entries.tpl is being parsed, there should be a <div class="serendipity_entry_extended"> for every entry in your blog, even if it's empty. A quick search shows that there's not.
That probably means that brownbag isn't actually the active template. To verify, try adding a bit of visible HTML (like <b>Entries.tpl parsed!</b>) to the index.tpl or entries.tpl. If you can't see it, we've been editing the wrong file all along.
Check the single-article view, too; it could be that we've made the change inside the wrong "if" statement.
In trying to debug, I can't find a template in the brownbag/ directory. I assume you're talking about brownpaper/? If that's the case, you actually need to copy the single-entry comment code from line 123 (just after the {if $is_single_entry and not $is_preview} line) to line 136 and move it where you want it displayed. (To avoid printing the comments twice on the single-entry page, you might consider surrounding the copied code with {if not $is_single_entry}{/if}.)
Note that the important part there is the {serendipity_printComments entry=$entry.id mode=$entry.viewmode}, which actually prints the comments. The other stuff is mostly for formatting and CSS.
Posted: Thu May 24, 2007 5:26 pm
by wtjoker
Thank you for the reply. I want to make sure I'm on the same page as you.
{if $is_single_entry and not $is_preview} <--Line 107
<div class="serendipity_comments serendipity_section_comments">
<br />
<a id="comments"></a>
<div class="serendipity_commentsTitle">{$CONST.COMMENTS}</div>
<div class="serendipity_center">{$CONST.DISPLAY_COMMENTS_AS}
{if $entry.viewmode eq $CONST.VIEWMODE_LINEAR}
({$CONST.COMMENTS_VIEWMODE_LINEAR} | <a href="{$entry.link_viewmode_threaded}#comments">{$CONST.COMMENTS_VIEWMODE_THREADED}</a>)
{else}
(<a href="{$entry.link_viewmode_linear}#comments">{$CONST.COMMENTS_VIEWMODE_LINEAR}</a> | {$CONST.COMMENTS_VIEWMODE_THREADED})
{/if}
</div>
<br />
{serendipity_printComments entry=$entry.id mode=$entry.viewmode}
{if $entry.is_entry_owner}
{if $entry.allow_comments}
<div class="serendipity_center">(<a href="{$entry.link_deny_comments}">{$CONST.COMMENTS_DISABLE}</a>)</div>
{else}
<div class="serendipity_center">(<a href="{$entry.link_allow_comments}">{$CONST.COMMENTS_ENABLE}</a>)</div>
{/if}
{/if}
<a id="feedback"></a>
{foreach from=$comments_messagestack item="message"}
<div class="serendipity_center serendipity_msg_important">{$message}</div>
{/foreach}
{if $is_comment_added}
<br /> <-- Line 137
Posted: Thu May 24, 2007 9:03 pm
by judebert
Looks like we've got different template files. Perhaps we're using different versions, or I'm confused over the template you're using.
In the snippet you provided, everything from 108 to 127 is what prints out the comment block for single entries. You should be able to copy it before or after the footer in the multiple-entry location, and comments will then be displayed on the main page.
A simpler solution might be to change the {if $is_single_entry and not $is_preview} on line 107 to just {if not $is_preview}. Then single-entry and multiple-entry pages should have comments displayed identically.