Re: How to get "Read More" link


#1

Well, there’s 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)
doesn’t really make it abundantly clear that there is more content to
follow - I’ve resorted to just wording the normal text to indicate
there’s more, then the user can click the usual links to make their way
through to the post.

Paul


From: removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalid] On Behalf Of Vamsee K.
Sent: 27 February 2006 15:18
To: removed_email_address@domain.invalid
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.


#2

Actually, I?ve done this on my blog (http://uzair.nairang.org), and it?s
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 don?t get inconsistent formatting because of, say, an open italics
tag.

In my themes/hemingway/articles/index.rhtml, I?ve 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: removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalid] On Behalf Of Paul I.
Sent: Monday, February 27, 2006 3:35 PM
To: removed_email_address@domain.invalid
Subject: Re: [typo] How to get “Read More” link

Well, there?s 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)
doesn?t
really make it abundantly clear that there is more content to follow ?
I?ve
resorted to just wording the normal text to indicate there?s more, then
the
user can click the usual links to make their way through to the post.

Paul


From: removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalid] On Behalf Of Vamsee K.
Sent: 27 February 2006 15:18
To: removed_email_address@domain.invalid
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.