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 Why Are The Events Not Listing The Same Way As UpComing In My Events Or Categories ?
"Unless I am mistaken it looks like this has been fixed today. ( Sat 25/03/17 )"
1 hour ago
Thisisbully replied to Mike Collins's discussion Ning Development - Roadmap
"a lot of stuff has been added they just didn't post it yet .For instance the comment wall in groups…"
4 hours ago
Alliance replied to Mike Collins's discussion Ning Development - Roadmap
"i agree a roadmap from April would be appreciated if you could. It gives us time to decide on work…"
19 hours ago
Kos replied to Bizz ( John )'s discussion Why Are The Events Not Listing The Same Way As UpComing In My Events Or Categories ?
"Yes sir"
23 hours ago
Bizz ( John ) replied to Bizz ( John )'s discussion Why Are The Events Not Listing The Same Way As UpComing In My Events Or Categories ?
"Kos I agree. Normally I am quite a patient person as I know writing code can take time with testing…"
23 hours ago
Kos replied to Bizz ( John )'s discussion Why Are The Events Not Listing The Same Way As UpComing In My Events Or Categories ?
"I was going to respond but felt I'd leave it to you John.  This is just insane!  You don't release…"
23 hours ago
Bizz ( John ) replied to Bizz ( John )'s discussion Why Are The Events Not Listing The Same Way As UpComing In My Events Or Categories ?
"I'm sorry, but why would a feature you have added that isn't working correctly not be a priority to…"
23 hours ago
Suki Winthrop replied to Bizz ( John )'s discussion What's Happened To The Activity Feeds ? None are showing on any sites including creators
"now my posts from 3weeks ago areshowing up as new posts  in Creator activity feed.  What the?"
yesterday
Suki Winthrop replied to Bizz ( John )'s discussion Why Are The Events Not Listing The Same Way As UpComing In My Events Or Categories ?
"So Events is the ONE new feature - aside from Google Capture,which you didn't create- that has been…"
yesterday
Beatriz Martín replied to ⚡JFarrow⌁'s discussion Clean, Robust, Filterable Community Member Directory
"But. If someone looks the source code (html) and search for the specific line of the awesome-table,…"
yesterday
Douwe Dronkert replied to Douwe Dronkert's discussion Can I just upgrade to Facebook Graph API v2.3 or higher?
"Hi Kyryl,
Thanks for your quick reply.
That's a pity. Is this kind of functionality something that…"
yesterday
Kyryl_Ning_Support replied to Yana Ning Support's discussion CAPTCHA - NO BOTS AND SPAMMY CONTENT
"Hi Kevin,
Former network creator has to fill the form http://hc.ning.com/contact/transferownership/&hellip;"
yesterday
Kyryl_Ning_Support replied to Yana Ning Support's discussion CAPTCHA - NO BOTS AND SPAMMY CONTENT
"Hi Anam,
We do apologise for the inconveniences.
The report has been created and passed to our tech…"
yesterday
Anam replied to Bizz ( John )'s discussion What's Happened To The Activity Feeds ? None are showing on any sites including creators
"Yes mine has been gone for 2 days and i have just filed ticket. I don't understand why there could…"
yesterday
Suki Winthrop replied to Yana Ning Support's discussion CAPTCHA - NO BOTS AND SPAMMY CONTENT
"Why does the Latest Activity feedhere on Creators now only show Ning's own Facebook posts ?!?
Pleaz…"
yesterday
More…