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

Profile IconBrother Richard, susana and 3 other members joined Allison Leahy's group
Thumbnail

The Sandbox

Join The Sandbox to experiment with Ning 3.0 now!The Ning Team will be triaging bug reports and…See More
15 minutes ago
Fire-Tech replied to Jen's discussion 'Jen's Running List - Updated 4/6/2013' in the group The Sandbox
"No prob. I have been equally frustrated and had to work on other things. But today...we got access…"
35 minutes ago
Fire-Tech replied to Phil McCluskey's discussion 'Site Manager Updates for Ning 3.0 Networks'
"Very very nice! Just the head tag alone makes me smile :) Great job...keep 'em coming!"
55 minutes ago
Phil McCluskey replied to Phil McCluskey's discussion 'Site Manager Updates for Ning 3.0 Networks'
"Hi Ningaholic, We've started working on Groups; there's still a few weeks to go, but they…"
59 minutes ago
Phil McCluskey replied to Phil McCluskey's discussion 'Site Manager Updates for Ning 3.0 Networks'
"Hi SP, Yes, right now it's a case of being in the blog you want to post to in order to add…"
1 hour ago
Coach Jon HighPoint IELTS Admin replied to Coach Jon HighPoint IELTS Admin's discussion 'Sandbox Project Report: HighPoint IELTS Prep' in the group The Sandbox
"Good news! It seems that our request was granted. :)"
1 hour ago
Coach Jon HighPoint IELTS Admin replied to Phil McCluskey's discussion 'Site Manager Updates for Ning 3.0 Networks'
"Whoa! @SweetPotato and I were talking about this a couple of weeks ago. Thanks for the quick…"
1 hour ago
Larry Matthews replied to Larry Matthews's discussion 'Anyone know how to fix Table Alignment ?'
"Thank you, will try now."
1 hour ago

© 2013   Created by Ning.

Badges  |  Report an Issue  |  Terms of Service