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 Social Network to add comments!

Join Ning Creators Social 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

Ceddy J replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
"So it just dawned on me that you're a CSS Maestro! Impressed by your chops."
3 hours ago
Kyryl_Ning_Support replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
"Hi there!
Here is what I have been able to do. all the following code sould be put in custom CSS fi…"
4 hours ago
Ning via Facebook

#Ning #search #news The long-awaited Search Option on Ning 3.0 is here! We are happy to…

Kos replied to Kyryl_Ning_Support's discussion The long-awaited Search Option is now at your fingertips!
"We've been waiting for years................Thank you (new) Ning!  Keep those improvements coming. "
5 hours ago
Kos replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
"YAYYYYY!  It's back!  The small chat in the corner is entirely too small for us - nothing is better…"
5 hours ago
Kyryl_Ning_Support replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
"IMPORTANT UPDATE!
If you are using the domain mapping it's necessary to use the custom domain name…"
5 hours ago
Kyryl_Ning_Support replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
"Hi Kos!
Regarding the Url to embed. Please check the third page with comments under this post. I ha…"
5 hours ago
Ceddy J replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
"Oh yes I love it the bubble! I live my life in a bubble lol."
6 hours ago
Kos replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
"Kyryl you must be the magic charm because low and behold......the sound began working today.  *lol*…"
6 hours ago
Ceddy J replied to Kyryl_Ning_Support's discussion The long-awaited Search Option is now at your fingertips!
"One recommendation is the advanced search filter like 2.0. This will allow for a great compliment t…"
6 hours ago
Jords replied to Kyryl_Ning_Support's discussion Paid Access demo version
"Thanks for passing this on Kyryl. :)"
6 hours ago
Kyryl_Ning_Support replied to Kyryl_Ning_Support's discussion Free Groups and Events Features for Ning 2.0 Mini plan!
"Hi Thiago,
I see that you have posted this suggestion everywhere you've been able to :-)
No worries…"
6 hours ago
Jords replied to Kyryl_Ning_Support's discussion The long-awaited Search Option is now at your fingertips!
"Excellent! To bad it's not July, because with these updates, it feels like Christmas!"
6 hours ago
Kyryl_Ning_Support replied to Kyryl_Ning_Support's discussion Paid Access demo version
"Hi there!
The paid access will be granting the access to the certain content for the paid members,…"
6 hours ago
Kyryl_Ning_Support replied to Kyryl_Ning_Support's discussion Paid Access demo version
"Hi Dan,
I'm sorry to say this but we already have necessary amount of beta testers :-(
But anyway t…"
6 hours ago
Kyryl_Ning_Support replied to Yana Ning Support's discussion Product Plan Update
"Hi there!
We have just run the test and chat seems to be working fine. Please try clear cache and c…"
6 hours ago
Kyryl_Ning_Support replied to Yana Ning Support's discussion Product Plan Update
"Hi there!
I have posted your suggestion to change the layout of the chat and left the same function…"
6 hours ago
Paul Corona replied to Dr. Krishna Kumari Challa's discussion I am unable to find discussions on my network when I search. Any solutions?
"I have this code on our main page as a search function that works well:
<form target="_new" action=…"
7 hours ago
Writer Chick {Diane} replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
"Okay, thanks for responding! "
7 hours ago
Kyryl_Ning_Support replied to Yana Ning Support's discussion Product Plan Update
"HI there!
Thanks for your nice words! Couid you please attach the screenshot how the serach looks o…"
7 hours ago
More…