view comments & add comment window section
Posted: Thu Jun 03, 2021 6:56 pm
Is there any way to make the 'comments & add comment' section to always show without having to click on it?
The place to find help and support
https://forum.flatpress.org/
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.
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">
Code: Select all
{comment_block}
...
{/comment_block}
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}
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}
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>
Code: Select all
<a href=\"" . get_permalink($id) . "#readmore-{$id}\">" . $readmoreString . "</a></span>";}