Adding "extended" content to existing page?

Newb here. Doing my best. I’ve spent many hours trying to figure this
one out, so far w/o success.

Is there any way to “extend” an article once it’s written.

By that, I mean to show only the first part of it and let the “Archive”
parent page print that part and then provide a “Read more” link.

I used the default site provided with the gem install, and then edited
the resulting pages.

I didn’t notice until afterwards that while new child pages I create
under the main Articles page have both “Body” and “Extended” parts, the
existing pages (which I edited) did not.

I’m confused as to who decides that gets put there, and how, and whether
it is changeable after the fact.

Thanks for any pointers I might elicit.

B.


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Brian,

Yes, that is one of the basic things that the “Styled Blog” template
does. Essentially you have this on the page that only displays part of
the article:

<r:children:each>

<r:content />
<r:if_content part=“extended”><r:link>Read
more…</r:link></r:if_content>
</r:children:each>

That loops through the child pages of the current page, displaying the
“body” part (that’s the <r:content /> tag), then a link if the
“extended” page-part exists. On the child page, you’d display both the
“body” and “extended” parts.

Sean C.
seancribbs.com

I didn’t notice until afterwards that while new child pages I create
under the main Articles page have both “Body” and “Extended” parts,
the
existing pages (which I edited) did not.

I’m confused as to who decides that gets put there, and how, and
whether
it is changeable after the fact.

You get to decide which pages have which parts yourself. If a page
has only a “body” part, edit the page look for the green-circled “+”
sign at the top-right corner of the content editing area. Click that
to add a new page part. In the “Add Part” dialog that pops up enter
the name “extended” and click the “Add Part” button.

  • Sean

I didn’t notice until afterwards that while new child pages I create

under the main Articles page have both “Body” and “Extended” parts,
the
existing pages (which I edited) did not.

I’m confused as to who decides that gets put there, and how, and
whether
it is changeable after the fact.

You can change which Parts are default in the database - config table,
default.parts field.

-Todd M

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs