Comments on: jQuery for Everyone: “Read More…” On a Blog Site http://www.endusersharepoint.com/2009/06/04/jquery-for-everyone-read-more-on-a-blog-site/ No GeekSpeak on SharePoint 2007 WSS and MOSS Mon, 27 Dec 2010 14:28:49 -0500 http://wordpress.org/?v=2.8.6 hourly 1 By: Sandhya.P http://www.endusersharepoint.com/2009/06/04/jquery-for-everyone-read-more-on-a-blog-site/comment-page-1/#comment-50413 Sandhya.P Mon, 29 Mar 2010 15:15:35 +0000 http://www.endusersharepoint.com/?p=1731#comment-50413 I tried adding the content editor webpart below the post webpart in a new sharepoint blog site. It works very well when i change id to Id from Id=WebPartWPQ1 to Id=WebPartWPQ6. But after testing this out in the new site I wanted to implement the same in the actual blog site where I already have an the following 1. an image webpart linked to an image 2. a contetn editor webpart with some links to blogging policy 3. Blog posts webpart Now I tried adding the CEWP webpart in this blog site below posts webpart. It doesnt adda ny read more link and basically I see no change in the site. But when I tried it in a new blog site it worked fine. Why not here..Can somebody help me out. in this blog site i have 33 posts already published and I have limited the number of items to display as 1-10 in a single page. Is this causing a problem. Also what is WebPartWPQ1? how do i check for this or what shud i make changes in the code. Is it not working becuase I am using it in an already existing blog site? Sandhya I tried adding the content editor webpart below the post webpart in a new sharepoint blog site. It works very well when i change id to Id from Id=WebPartWPQ1 to Id=WebPartWPQ6. But after testing this out in the new site I wanted to implement the same in the actual blog site where I already have an the following

1. an image webpart linked to an image
2. a contetn editor webpart with some links to blogging policy
3. Blog posts webpart

Now I tried adding the CEWP webpart in this blog site below posts webpart. It doesnt adda ny read more link and basically I see no change in the site. But when I tried it in a new blog site it worked fine. Why not here..Can somebody help me out. in this blog site i have 33 posts already published and I have limited the number of items to display as 1-10 in a single page. Is this causing a problem. Also what is WebPartWPQ1? how do i check for this or what shud i make changes in the code. Is it not working becuase I am using it in an already existing blog site?

Sandhya

]]>
By: Sietse http://www.endusersharepoint.com/2009/06/04/jquery-for-everyone-read-more-on-a-blog-site/comment-page-1/#comment-25285 Sietse Wed, 20 Jan 2010 17:51:44 +0000 http://www.endusersharepoint.com/?p=1731#comment-25285 hi there, I want to use the read more functionality on a announcement list. How can i make this possible? I'm not really a progammer... :) hi there,

I want to use the read more functionality on a announcement list. How can i make this possible?
I’m not really a progammer… :)

]]>
By: Sietse van der Haar http://www.endusersharepoint.com/2009/06/04/jquery-for-everyone-read-more-on-a-blog-site/comment-page-1/#comment-18864 Sietse van der Haar Sun, 08 Nov 2009 20:03:32 +0000 http://www.endusersharepoint.com/?p=1731#comment-18864 Hi there, Is it possible to use this script on a announcement list? That would be great! Hi there,

Is it possible to use this script on a announcement list? That would be great!

]]>
By: John http://www.endusersharepoint.com/2009/06/04/jquery-for-everyone-read-more-on-a-blog-site/comment-page-1/#comment-18134 John Mon, 19 Oct 2009 12:33:18 +0000 http://www.endusersharepoint.com/?p=1731#comment-18134 @ AutoSponge Thank you. Yes I increased the height to reveal more rows OK. But when I click Read More I see the Body text below these rows, so you lose sight of the Title and the first few rows. J @ AutoSponge

Thank you. Yes I increased the height to reveal more rows OK. But when I click Read More I see the Body text below these rows, so you lose sight of the Title and the first few rows.
J

]]>
By: AutoSponge http://www.endusersharepoint.com/2009/06/04/jquery-for-everyone-read-more-on-a-blog-site/comment-page-1/#comment-18133 AutoSponge Mon, 19 Oct 2009 12:07:32 +0000 http://www.endusersharepoint.com/?p=1731#comment-18133 @John, If you use something other than the default CSS, you may need to change this line: .collapseText {height:26px;overflow:hidden} Play with the height number until it looks right. @John,

If you use something other than the default CSS, you may need to change this line:
.collapseText {height:26px;overflow:hidden}

Play with the height number until it looks right.

]]>
By: John http://www.endusersharepoint.com/2009/06/04/jquery-for-everyone-read-more-on-a-blog-site/comment-page-1/#comment-18131 John Mon, 19 Oct 2009 10:35:51 +0000 http://www.endusersharepoint.com/?p=1731#comment-18131 Is there a way when you click read more that you see the top of the post containg the Title? Thanks Is there a way when you click read more that you see the top of the post containg the Title?
Thanks

]]>
By: John http://www.endusersharepoint.com/2009/06/04/jquery-for-everyone-read-more-on-a-blog-site/comment-page-1/#comment-18079 John Fri, 16 Oct 2009 15:16:22 +0000 http://www.endusersharepoint.com/?p=1731#comment-18079 This is great, thank you This is great, thank you

]]>
By: James http://www.endusersharepoint.com/2009/06/04/jquery-for-everyone-read-more-on-a-blog-site/comment-page-1/#comment-17335 James Tue, 22 Sep 2009 13:04:34 +0000 http://www.endusersharepoint.com/?p=1731#comment-17335 Thank you! This works great! Exactly what I needed! Thank you! This works great! Exactly what I needed!

]]>
By: AutoSponge http://www.endusersharepoint.com/2009/06/04/jquery-for-everyone-read-more-on-a-blog-site/comment-page-1/#comment-17316 AutoSponge Tue, 22 Sep 2009 00:02:26 +0000 http://www.endusersharepoint.com/?p=1731#comment-17316 @James, Try this (changing the h = variable will change the threshold for the read more link): <pre lang='javascript'> if(typeof jQuery=='undefined'){ var jQPath = 'https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' document.write(''); } .collapseText {height:26px;overflow:hidden} function collapseText(){ var h = 100, html = "<a href='#' rel="nofollow">Read more...</a>", divs = $("div.ms-PostBody"), i = divs.length, d; while (i--) { d = divs[i]; if (d.offsetHeight > h) { $(d).addClass("collapseText").after(html); } } $("a.expand").click(function(event){ $(event.target).parent().hide().prev().removeClass("collapseText"); $("html,body").scrollTop(event.pageY); return false; }); } $(function() { collapseText(); }); </pre> @James,

Try this (changing the h = variable will change the threshold for the read more link):


if(typeof jQuery=='undefined'){
	var jQPath = 'https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js'
	document.write('');
}

.collapseText 	{height:26px;overflow:hidden}

function collapseText(){
	var h = 100,
		html = "Read more...",
		divs = $("div.ms-PostBody"),
		i = divs.length, d;
	while (i--) {
		d = divs[i];
		if (d.offsetHeight > h) {
			$(d).addClass("collapseText").after(html);
		}
	}
	$("a.expand").click(function(event){
		$(event.target).parent().hide().prev().removeClass("collapseText");
		$("html,body").scrollTop(event.pageY);
		return false;
	});
}
$(function() {
	collapseText();
});
]]>
By: James http://www.endusersharepoint.com/2009/06/04/jquery-for-everyone-read-more-on-a-blog-site/comment-page-1/#comment-17306 James Mon, 21 Sep 2009 12:42:05 +0000 http://www.endusersharepoint.com/?p=1731#comment-17306 This is working great! Thanks for the post. Is there any way to set a condition based on height? Specifically, show the Read More/Collapse if the posting is longer than 100px? I am new to JQuery and can't seem to get it to accept the variable in the condition. This is working great! Thanks for the post. Is there any way to set a condition based on height? Specifically, show the Read More/Collapse if the posting is longer than 100px? I am new to JQuery and can’t seem to get it to accept the variable in the condition.

]]>