Hi all

Here is a simple tip to insert a "You Might Be Interested In ... " (call it whatever you like really) section at the bottom of all blog posts, sort of like we have Related Videos on the video module.

Here's how it looks:


What does it do? It pulls in the middle column modules from the blog page, e.g. Latest Blog Posts, Most Popular Blog Posts etc. In the example above it is pulling in the Latest Featured Blogs from the Featured blog posts page.

How to install it:

  • Add this script to your Custom Code box (also attached as a text file):
<!-- SP You Might Be Interested In -->
<script type="text/javascript">

x$(document).ready(function() {
x$('.xg_widget_profiles_blog_show .xg_module_with_dialog').append('<h2 class="interested">You Might Be Interested In ... </h2><div id="SPmoreblogs"></div>');
x$('.xg_widget_profiles_blog_show .xg_module_with_dialog #SPmoreblogs').load('/profiles/blog/list?promoted=1 .xg_widget_profiles_blog_list .xg_column.xg_span-4.xg_last .xg_module:contains("Latest Featured Blog Posts")');
});
</script>


The script looks for modules with certain headings on certain pages, so you can change the highlighted items to suit your needs.

  1. If you want the 'You Might Be Interested In ... ' to say something else then change the orange You Might Be Interested In ...
  2. If you want to load a module from the All Blogs page (rather than the Featured Blogs Page as I am using) then change /profiles/blog/list?promoted=1 to /profiles/blog/list
  3. If you want to load a box other than Latest Featured Blog Posts change it to whatever you want, e.g. Most Popular Blog Posts

 

  • Add this CSS to your Advanced CSS section in Design Studio, tweaking the bits that you need to

/*You might be interested font*/
.interested{

font-family:georgia!important;
font-style:italic!important;
font-size:24px;
color:#a10227!important;
margin-left:10px;
}

/*List items*/
#SPmoreblogs li {

background: #F9F9F9;
border: 1px solid #E4E4E4;
display: block;
float: left;
margin-right: 3px;
min-height: 58px;
padding: 5px;
width: 168px;
border-radius:3px;
-moz-border-radius:3px;
-webkit-border-radius:3px;
}

/*Removes border from module*/
#SPmoreblogs .xg_module{
margin-top:10px;
border:none;
}

/*Removes module header*/
#SPmoreblogs .xg_module_head{
display:none;
}

I hope this is of use. YOu can check out a live demo here.
Enjoy
SP

ps. this is for blogs only for now. Not had time to do the forum. Might get round to it at some point if no one else hacks it in the meantime.

Tags: Professional Ning Design, Related Items, You might be Interested in

Views: 1205

Attachments:

Reply to This

Replies to This Discussion

How can I change the number of related posts (from 7 to 3)?

Brilliant! Thanks SP!

This is a great tip SP but there's just one problem.  I'd like to have my most popular blog posts but there are 7 listed on the blog page at any given time (as opposed to 6 for featured blog posts).  That leaves an extra row with just one article in it which looks odd.  Is there any way to have it return only 6 articles so there are two clean rows?

Thanks in advance!  Love this option!!

yeah, i know what you mean, but i've not come up with a solution. sorry

KINDLY PLEASE CHECK MINE IT IS NOT WORKING www.edayan.net

on your page http://edayan.net/profiles/blog/list?promoted=1 you don't have a module header with the words "Latest Featured Blogs" but you do have "Latest Featured Blog Posts" so try that in the code instead

i tried this 

Top Blog Posts this Week

with adding this code but still not working

<!-- SP You Might Be Interested In -->
<script type="text/javascript">
x$(document).ready(function() {
x$('.xg_widget_profiles_blog_show .xg_module_with_dialog').append('<h2 class="interested">You Might Be Interested In ... </h2><div id="SPmoreblogs"></div>');
x$('.xg_widget_profiles_blog_show .xg_module_with_dialog #SPmoreblogs').load('/leaderboards/blogposts/week.xg_widget_profiles_blog_list .xg_column.xg_span-4.xg_last .xg_module:contains("Top Blog Posts this Week")');
});
</script>

you're trying to load modules from the leaderboard page, which is something entirely different, and your css classes are all worng as a result. 

<!-- SP You Might Be Interested In -->
<script type="text/javascript">
x$(document).ready(function() {
x$('.xg_widget_profiles_blog_show .xg_module_with_dialog').append('<h2 class="interested">You Might Be Interested In ... </h2><div id="SPmoreblogs"></div>');
x$('.xg_widget_profiles_blog_show .xg_module_with_dialog #SPmoreblogs').load('/profiles/blog/list.xg_widget_profiles_blog_list .xg_column.xg_span-4.xg_last .xg_module:contains("All Blog Posts")');
});
</script>

i tried this to bring all blog post but still not working

sorry to be a pain for you kindly please help

firstly, you need a space after /profiles/blog/

secondly, there is not a module in your middle column on your /profiles/blog/ page with the title "All Blog Posts". You have "Featured Blog Posts" etc. Try that instead

hhhhh................got it ...i love u sweet potato

RSS

Latest Activity

Thiago Santos de Moraes replied to Elshara Silverheart's discussion 'More Feature Requests'
"Thanks, Kos. I would like to understand the reason for this, it seems that the Ning wants to…"
38 minutes ago
Troy Marquis replied to Andrew Sanderson's discussion 'Video chat for ning network'
"skysa"
1 hour ago
Ambroise favorited Eric Suesz's page Ning 3.0 Roadmap
3 hours ago
Ambroise commented on kid k's group 'Ning French Networks'
"Dans le menu, il y a marqué Ning 3.0 lol"
3 hours ago
Jean-Christophe Fa(u)dot commented on kid k's group 'Ning French Networks'
"En ce qui me concerne, c'est à peine si je sais que Ning 3 existe ou va exister !…"
5 hours ago
SM replied to SM's discussion 'How to Target the First Page of your Site with CSS'
"Hi Suzie, here is the code you need to put into your bottom custom code box in the design center…"
6 hours ago
Kos replied to SM's discussion 'How to Target the First Page of your Site with CSS'
"ahhh now that makes sense.  Thanks for clarifying :)"
7 hours ago
Strumelia replied to FedMedic's discussion '3.0 Why is all my text centered?'
"Thanks so much, and please DO let me know what their support team is like, when you first make use…"
7 hours ago

© 2013   Created by Ning.

Badges  |  Report an Issue  |  Terms of Service