Actually, Ive done this on my blog (http://uzair.nairang.org), and its fairly simple. The tricky thing is that when you truncate the article on the front page, you have to sanitize the HTML and close any open tags, so that you dont get inconsistent formatting because of, say, an open italics tag.
In my themes/hemingway/articles/index.rhtml, Ive got this (lines 9-14): <div class="story<%= ' first' if i == 1 %>"> <h3><%= article_link article.title, article %></h3> <%= truncate(article.body_html, 500) %> <div class="details"> Posted at <%= article.created_at.strftime("%I").to_i </div> </div> The truncate() call returns just the first 500 characters of the article, sanitizing it first. I put the sanitizing function in app/helpers/application_helper.rb, since that's where the strip_html() function etc. are. If you like, I can send you my copy. Cheers, Uzair ________________________________________ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Ingles Sent: Monday, February 27, 2006 3:35 PM To: typo-list@rubyforge.org Subject: Re: [typo] How to get "Read More" link Well, theres the extended content box anything placed in which will ordinarily only be viewable when clicking to view a post. Although my current theme (hemingway from the Typogarden contest) doesnt really make it abundantly clear that there is more content to follow Ive resorted to just wording the normal text to indicate theres more, then the user can click the usual links to make their way through to the post. Paul ________________________________________ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Vamsee Kanakala Sent: 27 February 2006 15:18 To: typo-list@rubyforge.org Subject: [typo] How to get "Read More" link Hi all, Is there anyway I can limit the number of words in a given entry? Like, show them a little description, followed by a link "Read More". Clicking on which will lead to the actual article. Sorry if this has been asked before, I couldn't find anything on the archives. Thanks, Vamsee. This email and any attachments are confidential. They may contain privileged information and are intended for the named addressee(s) only. They must not be distributed without Perfect Information's consent. If you are not the intended recipient, please notify us immediately and do not disclose, distribute, or retain this email or any part of it. Unless expressly stated, opinions in this email are those of the individual sender, and not of Perfect Information. We believe but do not warrant that this e-mail and any attachments do not contain any form of virus. You must therefore take full responsibility for virus checking. Perfect Information reserves the right to monitor all email communications through their networks. _______________________________________________ Typo-list mailing list Typo-list@rubyforge.org http://rubyforge.org/mailman/listinfo/typo-list