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
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/ -
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: [email protected]
[mailto:[email protected]] On Behalf Of Ruben D.
Orduz
Sent: Tuesday, 14 November 2006 3:28 AM
To: [email protected]
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
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.
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.