Current status of the Ning Platform is always available on the Ning Status Blog.

Forum

How To Add Missing Blog Filter

One thing that is missing in the blogs pages is the chance to filter by Newest, Most Popular and Latest Activity, this is available in forums but not blogs so here is a way to be able to add one.

Maybe this is something the new Ning team could add but until then here is my option.

You can go to my blog page to see it working here : http://bizzssite.ning.com/blog

Let's get started.

First we need to add the sort options list onto the blog page. We do this for each blog instance you want to add the sort option for. So if you have more than one blog page you would just do this part on each of those pages.

  1. Go to your sites&pages and click on the blog page you are adding this to.
  2. Select the add content option and choose html, click on the small html icon and paste the html code below into it then click save/update
  3. Next move the html box to the top of your blog page.
  4. Save the page.

CODE TO PASTE INTO THE BOX ( DO NOT COPY THIS LINE )

<div class="filterBlogs">Sort Blogs<br />
<select name="sort" onchange="document.location.href=this.options[this.selectedIndex].value;">
<option value="/blog" selected="selected">Select An Option</option>
<option value="/blog?sort=newestPosts">Newest Posts</option>
<option value="/blog?sort=latestActivity">Latest Activity</option>
<option value="/blog?sort=mostPopular">Most Popular</option>
</select></div>

Now we need to add the CSS to your custom css section, we only need to do this once, it's only the html box's you copy more than once if you have multiple blog pages.

/** BLOGS FILTER CSS CODE **/
/* Filter Blogs Box Under Module Header In Blogs */
.filterBlogsBox{
    border-width:2px;
    border-style: none none solid;
    border-color: lightgrey;
    padding: 4px 10px;
    border-radius: 0px;}
/* Adjust the size for the font for the additional text under the name to show the filter state */
.blogListPage .sortstate{ font-size:0.6em }

Finally we add the Custom Code which goes into your Site Manager Custom Code End Of Page section. Again we only need to add this once.

<!-- ADDS THE TYPE OF FILTER YOU CHOSE TO THE BLOG HEADING WHEN SORTING -->
<script>
x$(document).ready(function() {
if(x$(location).attr('search')==="?sort=newestPosts"){
x$('.blogListPage .module-name').append("<div class='sortstate'>Sorted By: Newest Posts</div>");
}
});
</script>
<script>
x$(document).ready(function() {
if(x$(location).attr('search')==="?sort=latestActivity"){
x$('.blogListPage .module-name').append("<div class='sortstate'>Sorted By: Latest Activity</div>");
}
});
</script>
<script>
x$(document).ready(function() {
if(x$(location).attr('search')==="?sort=mostPopular"){
x$('.blogListPage .module-name').append("<div class='sortstate'>Sorted By: Most Popular</div>");
}
 });
</script>

<!-- FILTER TIPS BOX CLASS ADDITION TO THE HTML BOX -->
<script>
x$('.filterBlogs').closest('.grid-frame.sheet.section-html').addClass('filterBlogsBox');
</script>

<!-- PLACES THE BLOG FILTER UNDER THE MODULE HEADER MAIN SECTION -->
<script>
x$('.filterBlogsBox').prependTo('.section-primaryContent .blogListPage .module-body');
</script>
<!-- REMOVES THE BLOG FILTER UNDER THE MODULE HEADER DETAIL PAGE -->
<script>
x$(".blogDetailPage").parents().find(".filterBlogsBox").remove();
</script>

That's it your all done now you should have a blog filter.

John :-)

You need to be a member of Ning Creators Network to add comments!

Join Ning Creators Network

Email me when people reply –

Replies

  • I just added this to my site. Thank you so much! Do you know how to add a search box to my site? I would be so appreciative!

    • Hi Jennifer,

      Maybe Google Custom Search will be suitable for your network. You can find more bout his in our help center by following the link http://www.ning.com/ning3help/add-google-custom-search-to-your-netw...

      Best regards,

      Ning Team.

       

    • Your welcome Jennifer, pleased you found it useful. With regards to the search this is one of those items that the New Ning team are going to be adding in the future. Kyrl has pointed out the Google search you could add or Kos has used another one but cannot seem to find the post for it on the forum as yet, maybe she will pop into this with the link. I will keep searching though for you.

      John :-)

  • Thank you John!

This reply was deleted.

Search the Creators Network

Latest Activity

Bizz ( John ) replied to Bizz ( John )'s discussion Issue Running Scripts On Activity Feed More Items , Any Ideas How To Do This or Maybe Ning Could Help Out With A Little Info
"Thanks kyryl appreciate that"
1 hour ago
Kyryl_Ning_Support replied to Bizz ( John )'s discussion Issue Running Scripts On Activity Feed More Items , Any Ideas How To Do This or Maybe Ning Could Help Out With A Little Info
"Hi John,
Thanks for your feedback, we will forward this issue to our tech team.
Sorry for any incon…"
4 hours ago
Kyryl_Ning_Support replied to Robert Sheen's discussion why is my Ning site unavailable?
"Hi Michelle,
We have replied to you via private messages, please check.
Regards, 
Ning Team."
5 hours ago
Kyryl_Ning_Support replied to Hugh's discussion Latest on Ning and iframes?
"Hi Hugh,
Sorry for delayed response.
Your issue could be fixed pretty easily, just remove "-nocooki…"
6 hours ago
Michelle Stern replied to Robert Sheen's discussion why is my Ning site unavailable?
"I am sorry for butting in to this post but this is the only way I can post anything, I can't find h…"
7 hours ago
Michelle Stern, Brian Titus and Steve DeVore joined Ning Creators Network
7 hours ago
Hugh replied to Hugh's discussion Latest on Ning and iframes?
"Thanks for the reply. 
What I've always done is to take the YouTube code and paste it into html edi…"
yesterday
Kyryl_Ning_Support replied to Bryce Rubio's discussion A Follow-Up Message from our CEO
"Hi Kevin,
Apologies for the inconveniences and thanks for the feedback.
We have informed the manage…"
yesterday
Kyryl_Ning_Support replied to Bizz ( John )'s discussion Is This A New Feature ?
"Hi John,
We don't wish to disappoint you but this option was available before. This option is prett…"
yesterday
Kyryl_Ning_Support replied to Hugh's discussion Latest on Ning and iframes?
"Hi Hugh,
I have run the test on my test network by using the code provided by Youtube here https://…"
yesterday
Kos replied to Bryce Rubio's discussion A Follow-Up Message from our CEO
"Bryce chat, please, please, I'm grovelling, get chat released.........."
yesterday
David replied to David's discussion When are cancelled sites deleted?
"Thanks for the update, it's good to know it will eventually vanish."
yesterday
Kevin Acosta replied to Bryce Rubio's discussion A Follow-Up Message from our CEO
"Thank you for this venue to voice our issues and concerns as you plan and strategize upcoming enhan…"
yesterday
Kos replied to Hugh's discussion Latest on Ning and iframes?
"Absolutely they should.  File a ticket and get them on it.  Must be a new glitch"
yesterday
Kyryl_Ning_Support replied to Robert Sheen's discussion why is my Ning site unavailable?
"Hi there,
We have replied to you on the ticket that you have sent.
Best regards,
Ning Creators"
yesterday
Kos replied to Robert Sheen's discussion why is my Ning site unavailable?
"Sounds like they've deactivated you for some reason.  Contact them here.  Hope they get you up soon…"
yesterday
Carrie Robinson, Anthea Variend and Maureen Jansen joined Ning Creators Network
yesterday
Paul Corona replied to Robert Sheen's discussion why is my Ning site unavailable?
"we are having an issue with our site as well thought we're just getting and Unavailable message....…"
Tuesday
Bizz ( John ) replied to Bizz ( John )'s discussion How To Add A Popular Blogs Module ( ver1 )
"Thanks Kos
I will add one for forums and articles as well as it works virtually the same."
Tuesday
Kos replied to Bizz ( John )'s discussion How To Add A Popular Blogs Module ( ver1 )
"I think there are a lot of people who will love this tip.  Displaying the most popular 'anything' i…"
Tuesday
More…