This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.
When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:
If a blog has comments disabled in its setting, this is rendered on the page in list view:
<div class="blogcommentlink"> </div>
which turns into unwanted vertical space. Can this be excluded when comments are disabled please? A clean solution is to replace this in PostList.ascx:
<div class="blogcommentlink"> <asp:HyperLink ID="Hyperlink2" runat="server" EnableViewState="false" Text='<%# FeedBackLabel + "(" + DataBinder.Eval(Container.DataItem,"CommentCount") + ")" %>' Visible='<%# AllowComments && ShowCommentCounts %>' NavigateUrl='<%# FormatBlogUrl(DataBinder.Eval(Container.DataItem,"ItemUrl").ToString(), Convert.ToInt32(DataBinder.Eval(Container.DataItem,"ItemID"))) %>' CssClass="blogcommentlink"></asp:HyperLink> <asp:HyperLink ID="Hyperlink1" runat="server" EnableViewState="false" Text='<%# FeedBackLabel %>' Visible='<%# Config.AllowComments && !ShowCommentCounts %>' NavigateUrl='<%# FormatBlogUrl(DataBinder.Eval(Container.DataItem,"ItemUrl").ToString(), Convert.ToInt32(DataBinder.Eval(Container.DataItem,"ItemID"))) %>' CssClass="blogcommentlink"></asp:HyperLink>  </div>
<div class="blogcommentlink">
<asp:HyperLink ID="Hyperlink2" runat="server" EnableViewState="false" Text='<%# FeedBackLabel + "(" + DataBinder.Eval(Container.DataItem,"CommentCount") + ")" %>'
Visible='<%# AllowComments && ShowCommentCounts %>' NavigateUrl='<%# FormatBlogUrl(DataBinder.Eval(Container.DataItem,"ItemUrl").ToString(), Convert.ToInt32(DataBinder.Eval(Container.DataItem,"ItemID"))) %>'
CssClass="blogcommentlink"></asp:HyperLink>
<asp:HyperLink ID="Hyperlink1" runat="server" EnableViewState="false" Text='<%# FeedBackLabel %>'
Visible='<%# Config.AllowComments && !ShowCommentCounts %>' NavigateUrl='<%# FormatBlogUrl(DataBinder.Eval(Container.DataItem,"ItemUrl").ToString(), Convert.ToInt32(DataBinder.Eval(Container.DataItem,"ItemID"))) %>'
CssClass="blogcommentlink"></asp:HyperLink> 
</div>
with this:
<asp:Panel id="blogCommentLink" runat="server" cssclass="blogcommentlink" Visible='<%# AllowComments %>' > <asp:HyperLink ID="Hyperlink2" runat="server" EnableViewState="false" Text='<%# FeedBackLabel + "(" + DataBinder.Eval(Container.DataItem,"CommentCount") + ")" %>' Visible='<%# AllowComments && ShowCommentCounts %>' NavigateUrl='<%# FormatBlogUrl(DataBinder.Eval(Container.DataItem,"ItemUrl").ToString(), Convert.ToInt32(DataBinder.Eval(Container.DataItem,"ItemID"))) %>' CssClass="blogcommentlink"></asp:HyperLink> <asp:HyperLink ID="Hyperlink1" runat="server" EnableViewState="false" Text='<%# FeedBackLabel %>' Visible='<%# Config.AllowComments && !ShowCommentCounts %>' NavigateUrl='<%# FormatBlogUrl(DataBinder.Eval(Container.DataItem,"ItemUrl").ToString(), Convert.ToInt32(DataBinder.Eval(Container.DataItem,"ItemID"))) %>' CssClass="blogcommentlink"></asp:HyperLink>  </asp:Panel>
<asp:Panel id="blogCommentLink" runat="server" cssclass="blogcommentlink" Visible='<%# AllowComments %>' >
</asp:Panel>
In the interim we can of course disappear this area with css, but it would be nice if the markup was as clean as possible for the configured settings.
Also in the list, could we also disappear the Statistics entry for comments when comments are disabled. We get this output:
<li id="ctl00_mainContent_ctl00_postList_navTop_stats_liComments">Comments (0)</li>
which can be fixed by adding the "else" here in PostList.ascx.cs:
if (config.AllowComments) { ... } else { navTop.ShowCommentCount = false; }
if (config.AllowComments)
{
...
}
else
{ navTop.ShowCommentCount = false; }
these fixes are now in the source code repository
note that I did not change the div to a panel, I just added the id runat and visible properties to the existing div
Thanks,
Joe
Thanks Joe.
(I initially tried the same with that div (runat="server" etc) but for some reason it kept frying everything and I got build errors - maybe needed to delete and recreate the designer file or something? I should stick to the day job ;-)