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

Thisisbully replied to Thisisbully's discussion I'm losing members because of 1 silly feature
"Anything on this still have members that have no clue on how to post photos"
7 hours ago
Steve C replied to Kyryl_Ning_Support's discussion The long-awaited Search Option is now at your fingertips!
"Is there advanced search in 2.0 besides member search? I've never seen it and could really use it."
14 hours ago
Manuel Adame Jimenez replied to Yana Ning Support's discussion Video Feature on Ning 3.0 is now available!
"Hi, Kyryl, light works the way of your day, thank you, light.
☆♡☆"
15 hours ago
Kos replied to Yana Ning Support's discussion Video Feature on Ning 3.0 is now available!
"Kyryl I have to say how wonderful it is to have liaison who understands CSS/HTML.  Just love it!"
17 hours ago
Kyryl_Ning_Support replied to Yana Ning Support's discussion Video Feature on Ning 3.0 is now available!
"Hi there,
Just put this into your custom CSS code field to center the video.
.videoDetailPage-video…"
18 hours ago
Alex replied to Fabricio Giugni's discussion Powered by Ning How to get it out?
"Yes, Glam Media forced it upon us against Ning's original policy. Originally Ning communities had t…"
18 hours ago
Kos replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
"They told me there's nothing wrong. *lol* Wrong!"
19 hours ago
doone replied to Kyryl_Ning_Support's discussion The long-awaited Search Option is now at your fingertips!
"Thanks, it works great for me."
20 hours ago
Fabricio Giugni replied to Fabricio Giugni's discussion Powered by Ning How to get it out?
"    Be a White label is the best for creators. Force us to have they ads on our website is like ter…"
20 hours ago
Manuel Adame Jimenez replied to Yana Ning Support's discussion Video Feature on Ning 3.0 is now available!
"Hello Kyryl, I put a screen shot, to ask you to leave the video to the center or that is option to…"
20 hours ago
Alex replied to Kyryl_Ning_Support's discussion Paid Access demo version
"I find it completely astonishing that any other type of paid access could even be contemplated, whe…"
21 hours ago
Mike Collins replied to Fabricio Giugni's discussion Powered by Ning How to get it out?
"Hi Kyryl,
This was something that Glam Media brought in and it was a real sticking point for many c…"
22 hours ago
Kyryl_Ning_Support replied to Kyryl_Ning_Support's discussion The long-awaited Search Option is now at your fingertips!
"Hi there!
Thanks to both of you for your suggestions to add the advanced search option.
As I see su…"
23 hours ago
Kyryl_Ning_Support replied to Kyryl_Ning_Support's discussion The long-awaited Search Option is now at your fingertips!
"Hi Kos,
We are really sorry that it was necessary to wait for such a long time to see this feature…"
23 hours ago
Mike Collins replied to Kyryl_Ning_Support's discussion The long-awaited Search Option is now at your fingertips!
"Search is bringing up items from blogs/ discussions in private groups - please can this be changed…"
23 hours ago
Giovanni Cappai replied to Giovanni Cappai's discussion HTML under header not working :/
"Hi Kyryl, thanks for your reply. On firefox it works, on chrome still doesn't."
yesterday
Philip Voice replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
"I opened a private chat with one of my members yesterday. Nothing was typed in the chat by either o…"
yesterday
Kyryl_Ning_Support replied to Kyryl_Ning_Support's discussion Paid Access demo version
"Hi there!
Thanks for your feedback it is highly appreciated.
I have updated already existing sugges…"
yesterday
Kyryl_Ning_Support replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
"Hi there!
Thanks for useful suggestions! Some of them were completely new and some I have already p…"
yesterday
Philip Voice replied to Kyryl_Ning_Support's discussion The long-awaited Search Option is now at your fingertips!
"If anyone is interested if you want to do an off-grid search of your network (or any site) it's eas…"
yesterday
More…