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: 1186

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

Kos replied to SweetPotato's discussion 'Simple, Responsive Slider for Ning 3.0'
"No problemo. Most people actually have a life (except 4 me *lol*)  The problem seems…"
2 minutes ago
Elshara Silverheart replied to Tim's discussion 'Ning Slow Today?'
"Me two. I swear they create the status on status.ning.com before the error happens. Just kidding,…"
32 minutes ago
Elshara Silverheart replied to Jelena's discussion 'The new Spammers 3.0' in the group The Sandbox
"Anyone get a page not found error when trying to access their home page?"
1 hour ago
Tim replied to Tim's discussion 'Ning Slow Today?'
"500: Unexpected Error"
1 hour ago

NC for Hire
SweetPotato replied to SweetPotato's discussion 'Simple, Responsive Slider for Ning 3.0'
"Sorry, coming to this issue late on. Is it all ok now? It could have been Ning server issues as the…"
3 hours ago
LeyCosmica.org replied to LeyCosmica.org's discussion 'I can not access my site in any way'
"You can always access, everyone can access the site, even I can if I use internet connection…"
4 hours ago
Denis replied to PeruCool's discussion 'Alternatives to Ning social network'
"Great site man. Thanks for sharing the link. I am working on mine. I hope I will be done by the end…"
7 hours ago
Perrie Halpern replied to PeruCool's discussion 'Alternatives to Ning social network'
"Is there a specific code generator you use? I hope you don't mind me asking."
8 hours ago

© 2013   Created by Ning.

Badges  |  Report an Issue  |  Terms of Service