# Displaying Recent Articles

**URL:** <https://www.ruby-forum.com/t/displaying-recent-articles/198827>\
**Category:** Radiant CMS\
**Created:** [November 8, 2010, 9:30pm UTC](https://www.ruby-forum.com/t/displaying-recent-articles/198827 "2010-11-08T21:30:40Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![okkezSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/85f322/32.png) [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Post date:** [November 8, 2010, 9:30pm UTC](https://www.ruby-forum.com/t/displaying-recent-articles/198827/1 "2010-11-08T21:30:40Z")

</div>

Does anyone know of an extension that will allow me to automatically  
display recent articles with a title and a small excerpt?

---

<div class="post-metadata">

**Author:** ![obi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e9a140/32.png) [@obi](https://www.ruby-forum.com/u/obi)\
**Post date:** [November 8, 2010, 9:42pm UTC](https://www.ruby-forum.com/t/displaying-recent-articles/198827/2 "2010-11-08T21:42:01Z")

</div>

It’s built in.

\<r:find url="/news"\>

- 

This is off the top of my head so I’m not 100% sure that will work. But  
it’s close.

---

<div class="post-metadata">

**Author:** ![obi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e9a140/32.png) [@obi](https://www.ruby-forum.com/u/obi)\
**Post date:** [November 8, 2010, 11:22pm UTC](https://www.ruby-forum.com/t/displaying-recent-articles/198827/3 "2010-11-08T23:22:06Z")

</div>

Thanks Joel, I had no idea that was in there!

The code you sent me provides a list of links, is there anyway to format  
it so that it shows a small excerpt for each link, and keeps the site  
formatting styles (header1,2 etc.)?

Basically so it would look like this:

[http://img163.imageshack.us/img163/3228/screenshot20101108at191.jpg](http://img163.imageshack.us/img163/3228/screenshot20101108at191.jpg)

Any pointers would be greatly appreciated

---

<div class="post-metadata">

**Author:** ![obi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e9a140/32.png) [@obi](https://www.ruby-forum.com/u/obi)\
**Post date:** [November 9, 2010, 12:34am UTC](https://www.ruby-forum.com/t/displaying-recent-articles/198827/4 "2010-11-09T00:34:13Z")

</div>

Use a page part and call that if you want to choose the excerpt or you  
can  
use truncate [GitHub - saturnflyer/radiant-truncate-extension: Adds truncate tag to Radiant for truncating data within the tag.](https://github.com/saturnflyer/radiant-truncate-extension)  
to  
take the first X characters from the article and, well, truncate them.

–  
Rachel

---

<div class="post-metadata">

**Author:** ![obi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e9a140/32.png) [@obi](https://www.ruby-forum.com/u/obi)\
**Post date:** [November 8, 2010, 11:31pm UTC](https://www.ruby-forum.com/t/displaying-recent-articles/198827/5 "2010-11-08T23:31:31Z")

</div>

You should probably look at some documentation. For starters:

> **[Radius Tags](https://github.com/radiant/radiant/wiki/Radius-Tags)**
>
> Radiant is a no-fluff, open source content management system designed for small teams. - radiant/radiant

[http://radiantcms.org/blog/archives/2006/05/11/tag-primer/](http://radiantcms.org/blog/archives/2006/05/11/tag-primer/)

And my example was based on the assumption you had a page part for all  
your  
articles/posts called “excerpt”. If you don’t have one you’ll either  
have  
to add one or maybe use something like a text expander plugin of some  
sort  
(example: [http://plugins.learningjquery.com/expander/](http://plugins.learningjquery.com/expander/))

Good luck!

- Joel

---

<div class="post-metadata">

**Author:** ![obi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e9a140/32.png) [@obi](https://www.ruby-forum.com/u/obi)\
**Post date:** [November 9, 2010, 2:06am UTC](https://www.ruby-forum.com/t/displaying-recent-articles/198827/6 "2010-11-09T02:06:12Z")

</div>

Either make sure that only pages you want pulled in are under the url  
you’re  
pointing at (why is your contact us page under /articles ?) or look into  
featured pages  
[GitHub - saturnflyer/radiant-featured\_pages-extension: Adds the ability to feature pages in Radiant and list them without regard to their place in the page hierarchy](https://github.com/saturnflyer/radiant-featured_pages-extension) to  
select  
particular pages for display only.

–  
Rachel

---

<div class="post-metadata">

**Author:** ![obi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e9a140/32.png) [@obi](https://www.ruby-forum.com/u/obi)\
**Post date:** [November 9, 2010, 1:04am UTC](https://www.ruby-forum.com/t/displaying-recent-articles/198827/7 "2010-11-09T01:04:56Z")

</div>

Sweet, thanks Rachel, I’ll definitely check out that extension.

So far I’ve gotten the following code to do what I want:

\<r:find url="/articles"\>

- 
### 

Read this article

What would I need to add to this so that Radiant only pulls pages that  
have excerpts (to stop it pulling things like “contact us” pages or menu  
pages etc.?

Thanks!

---

<div class="post-metadata">

**Author:** ![obi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e9a140/32.png) [@obi](https://www.ruby-forum.com/u/obi)\
**Post date:** [November 9, 2010, 1:47pm UTC](https://www.ruby-forum.com/t/displaying-recent-articles/198827/8 "2010-11-09T13:47:41Z")

</div>

Sweet, thanks guys for all your help!

I got lots to read up on now 🙂

---

<div class="post-metadata">

**Author:** ![obi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e9a140/32.png) [@obi](https://www.ruby-forum.com/u/obi)\
**Post date:** [November 9, 2010, 3:24am UTC](https://www.ruby-forum.com/t/displaying-recent-articles/198827/9 "2010-11-09T03:24:00Z")

</div>

I’m about to announce a re-release of featured\_pages, but that’s not  
what you want here.  
I’m not sure why you have a ‘contact us’ page under articles, but you  
might have your reasons.

Using featured\_pages would require a lot of manual labor.  
What you want is for it to be automatic.

Just use the \<r:if\_url\> or \<r:unless\_url\> tags.

You can do something like this:

\<r:find url=“/articles”\>

- The wiki has a lot of great content
