Blogs "Most Viewed" etc.

rated by 0 users
This post has 5 Replies | 0 Followers

lhofthd
Not Ranked
Posts 9
Points 165
By: lhofthd
Posted: Sun, Apr 30 2006 4:33 AM

Need a little help with code if somebody has a moment: 
I'm trying to replicate the blogs' "most comments" and "most views" sidebar content parts on my main page and haven't been able to find one block of code to paste into my default.aspx to get the content and styling.  Does anyone know where I can find this?  Thanks! 

Here's what I've got so far (thanks to Ben Tiedt for everything except the botched styling efforts which I take full responsibility for and you can view here:
<div class="CommonSidebar">
<
div class="CommonSidebarArea">
<
div class="CommonSidebarContent">
<
Blog:AggregatePostList PageSize="3" SortBy="MostComments" runat="Server" id="Aggregatepostlist2">
<
SkinTemplate>
<Blog:AggregateList TitleTextLength=22 EnablePager=false id="Posts" runat="Server">
<SkinTemplate>
<asp:Repeater id="Posts" runat="Server" >
<ItemTemplate>
<div>
<h5><asp:HyperLink Runat="server" id="TitleLink" /></h5>
<div><asp:HyperLink runat="server" id="User" /></div>
<div><asp:Literal runat="server" id="Posted" /></div>
</div>
</ItemTemplate>
</asp:Repeater>
<CS:Pager runat="Server" id="PostsPager" Visible = "false" />
</SkinTemplate>
</Blog:AggregateList>
</
SkinTemplate>
</
Blog:AggregatePostList>
</
div>
</
div>
</
div>

Thanks, Patrick
 
  • Post Points: 20 |
Jaxon Rice
Top 100 Contributor
Posts 197
Points 4,135
MVPs
By: Jaxon Rice
Posted: Sun, Apr 30 2006 7:21 AM In reply to
try this code:
<Blog:AggregatePostList PageSize="3" SortBy="MostComments" runat="Server" id="Aggregatepostlist2">
  <SkinTemplate>
    <Blog:AggregateList TitleTextLength=22 EnablePager=false id="Posts" runat="Server">
      <SkinTemplate>
        <asp:Repeater id="Posts" runat="Server" >
          <HeaderTemplate>
          <div class="CommonSidebarArea">
            <h4 class="CommonSidebarHeader">Most Comments</h4>
              <div class="CommonSidebarContent">
          </HeaderTemplate>
          <ItemTemplate>
            <div class="CommonSidebarContentItem">
              <h5><asp:HyperLink Runat="server" id="TitleLink" /></h5>
              <asp:HyperLink runat="server" id="User" /><br />
              <asp:Literal runat="server" id="Posted" />
            </div>
          </ItemTemplate>
          <FooterTemplate>
            <CS:Pager runat="Server" id="PostsPager" Visible = "false" />
            </div>
            </div>
          </FooterTemplate>
        </asp:Repeater>
      </SkinTemplate>
    </Blog:AggregateList>
  </SkinTemplate>
</Blog:AggregatePostList>

You will also want to add the following CSS code to your common.css file:


.CommonSidebarContentItem h5{
      margin:0;
      }

I think this should work - let me know how it turns out

 
  • Post Points: 20 |
lhofthd
Not Ranked
Posts 9
Points 165
By: lhofthd
Posted: Sun, Apr 30 2006 3:14 PM In reply to

Works great, all I need to do is get the text size a little smaller to match the blogs page and so that it doesn't wrap under.  Think you could point me in the right direction?  Thanks for your help!  This might be a good tutorial for your tips blog, what do you think? 

Thanks, Patrick
 
  • Post Points: 20 |
Jaxon Rice
Top 100 Contributor
Posts 197
Points 4,135
MVPs
By: Jaxon Rice
Posted: Mon, May 1 2006 8:21 AM In reply to

Hi Patrick

Can you point me to a page that has your control on it? It seems to work fine on my test servers, so I don;t understand what you mean by wrap under.

 
  • Post Points: 20 |
lhofthd
Not Ranked
Posts 9
Points 165
By: lhofthd
Posted: Mon, May 1 2006 11:08 PM In reply to
Thanks again for your help, I just needed the text a bit smaller.  Here's the code I'm using at www.buyspace.com - This exactly replicates the content on the blogs page.  The only problem I have now is that the control automatically sets the browser title to include "Blogs" which is OK but I'd like to remove it eventually and add "Home".  Any pointers for a new community?  Cheers!

<Blog:AggregatePostList PageSize="3" SortBy="MostComments" runat="Server" id="Aggregatepostlist2">
<
SkinTemplate>
<Blog:AggregateList TitleTextLength=22 EnablePager=false id="Posts" runat="Server">
<SkinTemplate>
<asp:Repeater id="Posts" runat="Server" >
<HeaderTemplate>
<div class="CommonSidebarArea">
<h4 class="CommonSidebarHeader">Add Title Here</h4>
<div class="CommonSidebarContent">
<ul class="CommonSidebarList">
</HeaderTemplate>
<ItemTemplate>
<li>
<asp:HyperLink Runat="server" id="TitleLink" />
</li>
</ItemTemplate>
<FooterTemplate>
</ul>
</div>
</div>
</FooterTemplate>
</asp:Repeater>
</SkinTemplate>
</Blog:AggregateList>
</
SkinTemplate>

Thanks, Patrick
 
  • Post Points: 20 |
Jaxon Rice
Top 100 Contributor
Posts 197
Points 4,135
MVPs
By: Jaxon Rice
Posted: Tue, May 2 2006 8:24 AM In reply to

Hi Patrick

There is an attribute called EnableTitle that I would think would turn off that feature, but it does not seem to work. I have to confess that I have no idea how to prevent "blogs" from appearing in the site title.

 
  • Post Points: 5 |
Page 1 of 1 (6 items) | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com