# Sticky Posts

**URL:** <https://www.ruby-forum.com/t/sticky-posts/75814>\
**Category:** Radiant CMS\
**Created:** [November 13, 2006, 5:29pm UTC](https://www.ruby-forum.com/t/sticky-posts/75814 "2006-11-13T17:29:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruben\_DSOrduz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a88e4f/32.png) [@Ruben\_DSOrduz](https://www.ruby-forum.com/u/Ruben_DSOrduz)\
**Post date:** [November 13, 2006, 5:29pm UTC](https://www.ruby-forum.com/t/sticky-posts/75814/1 "2006-11-13T17:29:24Z")

</div>

Hey guys (I know…I should be debugging .Net code…I’m a bad  
employee),

What’s would be the most painless way to add a “sticky” behavior to  
posts?  
For example…something I wish to remain in the front page in spite of  
its  
publishing date. Any help is much appreciated…Jose…if I can get a  
few  
more minutes off, I’ll look into the routes.rb file and let you know  
which  
lines I’d be messing with 🙂

---

<div class="post-metadata">

**Author:** ![Ruben\_DSOrduz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a88e4f/32.png) [@Ruben\_DSOrduz](https://www.ruby-forum.com/u/Ruben_DSOrduz)\
**Post date:** [January 16, 2007, 3:06am UTC](https://www.ruby-forum.com/t/sticky-posts/75814/2 "2007-01-16T03:06:49Z")

</div>

If you’re willing to play with the mental branch, I’ve done something  
similar in my extension that I’m working on for the website I’m working  
on - The main page will always have a feature article that might not  
necessarily be the latest article - it will simply be the most recent  
article marked as a ‘feature’.

Poke around [http://soxbox.no-ip.org/radiant/svn/extensions/x\_groggy/](http://soxbox.no-ip.org/radiant/svn/extensions/x_groggy/) -  
there’s heaps of other crap in there, but mainly you just want to look  
at the article\_page.rb, article\_metadata.rb and the articles:feature and  
articles:each tags in lib/groggy\_tabs.rb. I haven’t added in the bit to  
actually SET that flag, but it’ll just be a check-box on the article  
editing page.

Dan.

* * *

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Ruben D.  
Orduz  
Sent: Tuesday, 14 November 2006 3:28 AM  
To: removed\_email\_address@domain.invalid  
Subject: [Radiant] Sticky Posts

Hey guys (I know…I should be debugging .Net code…I’m a bad  
employee),

What’s would be the most painless way to add a “sticky” behavior  
to posts? For example…something I wish to remain in the front page in  
spite of its publishing date. Any help is much appreciated…Jose…if  
I can get a few more minutes off, I’ll look into the routes.rb file and  
let you know which lines I’d be messing with 🙂

---

<div class="post-metadata">

**Author:** ![Ruben\_DSOrduz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a88e4f/32.png) [@Ruben\_DSOrduz](https://www.ruby-forum.com/u/Ruben_DSOrduz)\
**Post date:** [January 16, 2007, 3:27am UTC](https://www.ruby-forum.com/t/sticky-posts/75814/3 "2007-01-16T03:27:53Z")

</div>

Huh huh…very, very, very interesting Daniel. Don’t know if you saw  
my other post regarding this issue, but in essence I “cheated” and  
didn’t mess with mental branch at all. I basically created a column in  
the pages table called “is\_featured” of type tinyint (I only want  
1||0), default 0. Then I used the \<r:find\> tag and used the  
“by=columnName” argument to retrieve the latest post marked as  
featured. Then hacked a checkbox in the admin interface that sets an  
article as being featured.

---

<div class="post-metadata">

**Author:** ![Ruben\_DSOrduz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a88e4f/32.png) [@Ruben\_DSOrduz](https://www.ruby-forum.com/u/Ruben_DSOrduz)\
**Post date:** [January 16, 2007, 3:34am UTC](https://www.ruby-forum.com/t/sticky-posts/75814/4 "2007-01-16T03:34:55Z")

</div>

Heh - I just realised that I had the folder sorted by subject rather  
than date and was replying to an old post.

That’s probably the approach I would’ve used in radiant 0.5.2, but the  
extensions mechanism in mental has curbed just about every temptation I  
have to touch the core.
