view comments & add comment window section
view comments & add comment window section
Is there any way to make the 'comments & add comment' section to always show without having to click on it?
-
- Posts: 26
- Joined: Wed Dec 30, 2020 9:58 pm
Re: view comments & add comment window section
I'm very new to FlatPress and can find no way to force this within the Admin interface.
However, in my brief testing it appears that once a comment is made then the Add Comment box will appear automatically under the first comment.
Overall, the Comments facility appears a little clunky. I find that when you click on the Add Comment link the entire page redraws so, if you are commenting on a long post, you have a lot of scrolling to do. Surely that ought to be done for you, if it is not possible to coe the page so the comment box simply opens on the page forcing the fotter a little further down. And, if you are in the habit of deleting comments, and you enable the LastComments plugin then also enabling the LastComments Admin becomes essential as you need to rebuild the index after each comment deletion.
However, in my brief testing it appears that once a comment is made then the Add Comment box will appear automatically under the first comment.
Overall, the Comments facility appears a little clunky. I find that when you click on the Add Comment link the entire page redraws so, if you are commenting on a long post, you have a lot of scrolling to do. Surely that ought to be done for you, if it is not possible to coe the page so the comment box simply opens on the page forcing the fotter a little further down. And, if you are in the habit of deleting comments, and you enable the LastComments plugin then also enabling the LastComments Admin becomes essential as you need to rebuild the index after each comment deletion.
Re: view comments & add comment window section
In fact, there is. But this is not an option in the admin area; instead, the templating system allows you to completely freely change the output of your blog to your needs.
The following steps will add the detailled comments to the entry page for the default theme Leggero v2, you may need to adapt this to the theme you use on your blog.
The entry page
At first, clicking on an entry title on your entry overview page will bring you to the single entry (e.g. http://example.org/index.php/2021/04/21 ... flatpress/ - the URL might look different according to your PrettyURLs plugin settings).
fp-interface/themes/leggero/entry-default.tpl defines how this page looks like.
At line 29, you'll find:
Code: Select all
{if !(in_array('commslock', $categories) && !$comments)}
<li class="link-comments">
<a href="{$id|link:comments_link}#comments">{$comments|tag:comments_number}
{if isset($views)}(<strong>{$views}</strong> views){/if}
</a>
</li>
{/if}
Code: Select all
<a href="{$id|link:comments_link}#comments">
The entry's comment page
When clicking this link, you will be lead to the comments page of the entry, http://example.org/index.php/2021/04/21 ... /#comments (see the trailing "/comments" that tells FlatPress to display the comments page, and the "#comments" that tells your browser to scroll down to the comments section as soon as the page is loaded).
The output of the comments page of the entry is defined by fp-interface/themes/leggero/comments.tpl, which is pretty interesting: In line 6, entry-default.tpl is included, we inspected this file a minute ago! So what is in entry-default.tpl, will be shown at line 6, and then, there come the comments: The whole section
Code: Select all
{comment_block}
...
{/comment_block}
And finally: Putting the comments to the entry page
Now it's as simple as you might already think: Why not just taking the whole {comment_block} section from comments.tpl and insert it into entry-default.tpl?
Code: Select all
<div itemscope itemtype="http://schema.org/BlogPosting" id="{$id}" class="entry {$date|date_format:"y-%Y m-%m d-%d"}">
{* using the following way to print the date, if more *}
{* than one entry have been written the same day, *}
{* the date will be printed only once *}
{$date|date_format_daily:"<h2 class=\"date\">`$fp_config.locale.dateformat`</h2>"}
<h3 itemprop="name">
<a href="{$id|link:post_link}">
{$subject|tag:the_title}
</a>
</h3>
{include file=shared:entryadminctrls.tpl}
<span itemprop="articleBody">
{$content|tag:the_content}
</span>
<ul class="entry-footer">
<li class="entry-info">Posted by <span itemprop="author">{$author}</span> at
{$date|date_format}
<span itemprop="articleSection">
{if ($categories)} in {$categories|@filed}{/if}
</span>
</li>
{if !(in_array('commslock', $categories) && !$comments)}
<li class="link-comments">
<a href="{$id|link:comments_link}#comments">{$comments|tag:comments_number}
{if isset($views)}(<strong>{$views}</strong> views){/if}
</a>
</li>
{/if}
</ul>
</div>
<!-- the following is the comments block "borrowed" from comments.tpl! :) -->
{comment_block}
<ol id="comments">
{comment}
<li id="{$id}" {$loggedin|notempty:"class=\"comment-admin\""}>
<strong class='comment-name'>
{*
using this tag combo, the name is displayed as a link only
if user entered a URL.
Syntax is quite intuitive:
"if $url is not empty, show $name between a tags,
else default fallback on displaying plain $name"
*}
{$url|notempty:"<a href=\"$url\" rel=\"nofollow\" title=\"Visit $url\">$name</a>"|default:$name}
</strong>
{include file=shared:commentadminctrls.tpl} {* this shows edit/delete links*}
<p class="date">
<a href="{$entryid|link:comments_link}#{$id}" title="Permalink to {$name}'s comment">{$date|date_format:"%A, %B %e, %Y - %H:%M:%S"}</a>
</p>
{$content|tag:comment_text}
</li>
{/comment}
</ol>
{/comment_block}
Hope that helps you, let me know!
All the best,
Arvid
Re: view comments & add comment window section
So the entire 'comments.tpl code' is transfered to replace the 'entry-default.tpl' ?
Re: view comments & add comment window section
ok - entered it in entry_default.tpl - but all looks the same.
Still have to click on 'add comment'.
Still have to click on 'add comment'.
Code: Select all
<div itemscope itemtype="http://schema.org/BlogPosting" id="{$id}" class="entry {$date|date_format:"y-%Y m-%m d-%d"}">
{* using the following way to print the date, if more *}
{* than one entry have been written the same day, *}
{* the date will be printed only once *}
{$date|date_format_daily:"<h2 class=\"date\">`$fp_config.locale.dateformat`</h2>"}
<h3 itemprop="name">
<a href="{$id|link:post_link}">
{$subject|tag:the_title}
</a>
</h3>
{include file=shared:entryadminctrls.tpl}
<span itemprop="articleBody">
{$content|tag:the_content}
</span>
<ul class="entry-footer">
<li class="entry-info">Posted by <span itemprop="author">{$author}</span> at
{$date|date_format}
<span itemprop="articleSection">
{if ($categories)} in {$categories|@filed}{/if}
</span>
</li>
{if !(in_array('commslock', $categories) && !$comments)}
<li class="link-comments">
<a href="{$id|link:comments_link}#comments">{$comments|tag:comments_number}
{if isset($views)}(<strong>{$views}</strong> views){/if}
</a>
</li>
{/if}
</ul>
</div>
<!-- the following is the comments block "borrowed" from comments.tpl! :) -->
{comment_block}
<ol id="comments">
{comment}
<li id="{$id}" {$loggedin|notempty:"class=\"comment-admin\""}>
<strong class='comment-name'>
{*
using this tag combo, the name is displayed as a link only
if user entered a URL.
Syntax is quite intuitive:
"if $url is not empty, show $name between a tags,
else default fallback on displaying plain $name"
*}
{$url|notempty:"<a href=\"$url\" rel=\"nofollow\" title=\"Visit $url\">$name</a>"|default:$name}
</strong>
{include file=shared:commentadminctrls.tpl} {* this shows edit/delete links*}
<p class="date">
<a href="{$entryid|link:comments_link}#{$id}" title="Permalink to {$name}'s comment">{$date|date_format:"%A, %B %e, %Y - %H:%M:%S"}</a>
</p>
{$content|tag:comment_text}
</li>
{/comment}
</ol>
{/comment_block}
Re: view comments & add comment window section
It took a while for some changes to respond.
The result is the list menu and all that follows the list ends up in the bottom.
The live post area extends to fill its place.
However, the comments section remains how it was before.
I can't figure it out is why sice the only change was a borrowed section added to the entry_default'
I tried a couple of times starting fresh since I have the original backed up... and
both times got the same resilts.
regardless, I appreciate the suggestions you made.
Judging from past experience, I have noticed that an open view of the comments window gets more comments.
the total amount of views remain about the same except for the interaction with the viewers.
That was the only reason I had inquired about this.
The result is the list menu and all that follows the list ends up in the bottom.
The live post area extends to fill its place.
However, the comments section remains how it was before.
I can't figure it out is why sice the only change was a borrowed section added to the entry_default'
I tried a couple of times starting fresh since I have the original backed up... and
both times got the same resilts.
regardless, I appreciate the suggestions you made.
Judging from past experience, I have noticed that an open view of the comments window gets more comments.
the total amount of views remain about the same except for the interaction with the viewers.
That was the only reason I had inquired about this.
Re: view comments & add comment window section
Okay, fresh start. There are two possibilities to display the comments: On your blog's overview page, and on each blog entry.
To have the comments displayed for each entry on your overview page and on each entry's page, the changes described above work for me.
My entry-default.tpl: Essentially, adding the comments block to this file makes the comments a part of the entry. Whereever the entry is displayed (on the overview page, or on the entry's page itself), the comments will be shown.
The output is as follows:
To keep the overview page free of comments (which looks better to my eyes), and display the comments just on each entry's page, the solution is even easier.
How do we get to an entry's page? By clicking on the entry title on the overview page. We could now simply change this link so it will lead us directly to the comments page of the entry (where the comments are shown) instead of the entry page (where they are not).
In entry-default.tpl, you'll find:
All the best,
Arvid
To have the comments displayed for each entry on your overview page and on each entry's page, the changes described above work for me.
My entry-default.tpl: Essentially, adding the comments block to this file makes the comments a part of the entry. Whereever the entry is displayed (on the overview page, or on the entry's page itself), the comments will be shown.
The output is as follows:
To keep the overview page free of comments (which looks better to my eyes), and display the comments just on each entry's page, the solution is even easier.
How do we get to an entry's page? By clicking on the entry title on the overview page. We could now simply change this link so it will lead us directly to the comments page of the entry (where the comments are shown) instead of the entry page (where they are not).
In entry-default.tpl, you'll find:
Just change this to:<h3 itemprop="name">
<a href="{$id|link:post_link}">
<!-- this will lead to the entry page, but you'll have to click on the comment link ("3 comments") there to actually see the comments -->
{$subject|tag:the_title}
</a>
</h3>
Please give that a try, especially the second suggestion might be what you're looking for.<h3 itemprop="name">
<a href="{$id|link:comments_link}">
<!-- this will directly lead to the comments page of the entry - exactly where you get to by clicking on the "3 comments" link on the entry page -->
{$subject|tag:the_title}
</a>
</h3>
All the best,
Arvid
Re: view comments & add comment window section
Bingo !
The replacement code for the entry-default.tpl worked perfectly.
... and the overview is usually without comments anyway.
Thank you Arvid !
The replacement code for the entry-default.tpl worked perfectly.
... and the overview is usually without comments anyway.
Thank you Arvid !
Re: view comments & add comment window section
Just noticed - when [read more] is clicked, it shows original linking of the post without the comments window.
is possible to apply the 'comments window', to posts where the [read more] added ?
A big percentage of my posts contain [read more]
I checked thru the code @ the panel & have found nothing in feference to [read more]
is possible to apply the 'comments window', to posts where the [read more] added ?
A big percentage of my posts contain [read more]
I checked thru the code @ the panel & have found nothing in feference to [read more]
Re: view comments & add comment window section
found this in '/plugin.readmore.php
Code: Select all
<a href=\"" . get_permalink($id) . "#readmore-{$id}\">" . $readmoreString . "</a></span>";}
Who is online
Users browsing this forum: No registered users and 14 guests