M@'s Musings

« Back to blog
 

Comatose, TaskTHIS, and Theme Support. Oh My!

Well, I’ve been a little remiss in my open-source development of late. Many apologies, things have been a bit hectic. You know the feeling, I’m sure.

But that’s not why I’m posting. I thought I’d outline my ideas for the future of these projects and get your feedback and/or ideas.

Comatose, The Micro CMS Plugin

The things that are definitely coming…

Edge Rails – Since Rails 1.2 is now official, it’s time to finally support ‘edge rails’. :-D

Actually, I have a version that runs on Rails 1.2 now, but I’m debating about Rails 1.1 backward compatibility. The new version changes quite a bit. The DEFER_COMATOSE_LOAD stuff goes away, replaced by better configuration support and a Dispatch::to_prepare block. Plus you no longer override the ComatoseAdminController for authentication, instead in the configuration you specify modules to include in the class. Oh yeah, and the controllers no longer extend ApplicationController.

Test Harness – The tests in the plugin itself are very spartan, at best. I have a horribly ugly test harness I use for the actual unit testing that I’m going to clean up and release.

Some possibilities

Liquid Only – I really think I’m going to drop ERb support. How many of you use ERb over Liquid for page processing?

RESTful Pages – Perhaps using the new RESTfully CRUDDY support would be useful. The idea of having an API for pages is interesting.

Mount Behaviors – I haven’t thought this through yet, it just popped into my head: map.comatose_root 'devblog', :index=>'blog', :behavior=>'blog'

This example would add ‘blog-like’ support such as all children being paged entries (showing last 10, next page, last page, etc.), automatic hAtom microformat support, and maybe some sort of archives… I don’t know. I still haven’t thought about this too much.

The behavior support would be pluggable, much like text-filters and drops… Can you think of any other behavior that would make sense?

Maybe :behavior=>'syndicated' to create RSS/ATOM feeds of the child pages? Perhaps they’d be mixable by saying :behavior=>'blog syndicated' or :behavior=>'blog,syndicated'.

The probably nots

Media Management – It just feels like too much. I have a hacked up version of Comatose that supports page attachments. But you wind up having to deal with upload directories, and file permissions and… It just feels too heavy. And too heavy != micro.

Perhaps it could be a separate plugin?

TaskTHIS

TaskTHIS is getting a bit long in the tooth. It was written right about the time some of my AJAX patches were being added to Rails. Which was pre 1.0. So, yeah. It needs some love.

It was created as a show-and-tell for the then-new-and-nifty AJAX support. Which, of course, is now old hat.

In keeping with the tradition of show-and-tell, I thought TaskTHIS would be an excellent application to show how to use the new CRUD/REST/Resources stuff in Rails 1.2.

I have a few ideas outlined here. The biggest ones are:

API – This is fairly straight-forward, we’ll get most if it from Rails. We’ll just add the appropriate authentication for the XML requests.

OpenID – I was thinking replacing the existing login system with OpenID authentication. I like the idea of just typing in my domain to login… Who needs passwords? Seriously though, this may be a bit controversial — please weigh in.

Oh, I forgot to mention, TaskTHIS.com is working again.

Theme Support Plugin

Basically, just add any outstanding patches and ensure it works on Rails 1.2. I imagine the routing stuff will need to be tweaked.

Whadda Ya Think?

What would/wouldn’t you like to see in any of these projects?

Posted
25 Comments
Jan 25, 2007
sergio t. ruiz said...
hey, matt..
just wanted to put my vote in really quick.. i am using the themes plugin for alot of projects, and mine just broke.. i would like to see this reworked for rails 1.2..
i started working on it last night, but i am short on time t his week..
anyway.. good work on all your stuff!
you rock!
Jan 25, 2007
M@ said...
[finn:6] Yes, I will definitely be releasing an updated version with Rails 1.2 support. It's coming the next couple of days, probably.
Just fishing around for feedback about the other ideas.
Oddly, nobody has said they need Rails 1.1 support. Which is good, that'll make this next release quick and easy!
Jan 31, 2007
Galen said...
Matt, nice work! We've been integrating Comatose into our systems and find it to be fantastic as it does just the bare bones and allows us to custom-build the rest of our functionality as needed and we're not having to fit into someone else's CMS box.\n\nOne thing I would love to see is some sort of extending model. For example, we really need the ability to be able to have fields in Comatose for page title, link title AND slug. This is because the link the user clicks on is often a short title whereas the page title that is displayed in the page (and in the nav bar) is often longer. The slug, of course, is short and concise and can't contain special characters.\n\nDo do this, we added a column to the pages table and added a field to the admin layout.\n\nWhat would be better would be to allow developers to create a "comatose_options" table that is linked to a page by a page_id column. We could then put as many new columns in this options table as we need and Comatose could automatically render the fields in the admin view.\n\nDoes this make sense? It would mean we don't have to hack Comatose so it wouldn't break next time we update.\n\nAnyway, keep up the great work!\n\nHere's a site based on Comatose for your reference: "Ruby Bay Lodge & Vineyard":http://www.rubybayvineyard.co.nz
Feb 12, 2007
Nate said...
The Themes plugin has been awesome. Thank you for this contribution.
I've had the Themes plugin working in 1.2/edge with these hacks:
First, I commented out everything in routeset_ex.rb. And added those routes manually to "my routes.rb":http://pastie.caboo.se/39806
I've also just got ActionMailer themes working by changing the initialize method in actionmailer_ex.rb. Here's a diff. Basically I just made sure the theme parameter was indeed lobbed off the array, the original way just empties out the hash parameter at the end and sticks a :current_theme in there, so the create! method was complaining about too many parameters. It seems to work, but I'm still a little confused what the consequences of not having that :current_theme param sent into "create!" is about to have.
"http://pastie.caboo.se/39808":http://pastie.caboo.se/39808
Feb 14, 2007
mond said...
[Nate:11] Thanks for tip how to solve problem with routes.\n\nAnyone know how to solve this:\nhttp://groups.google.com/group/liquid-templates/browse_thread/thread/eef63c5d...\n?
Feb 25, 2007
Tim said...
Oh please don't nuke erb support. And any chance that you can get the themes_support fixed for 1.2? Also ActionMailer is still busted for me when I try to send multi-part messages:
No rhtml, rxml, or delegate template found for user_notifier/signup_notification.text.html.rhtml
Mar 02, 2007
Rajesh said...
Matt, Did you fix Theme generator for Rails 1.2, Is there any way I can pull the version that would work with Rails 1.2 ?
Mar 05, 2007
Rajesh said...
I have posted the fix for the Theme support plugin and Rails 1.2.X in Rub y Forum. Here is the link
http://www.ruby-forum.com/topic/100163#215694
Mar 07, 2007
seth said...
this patch works for me on rails 1.2.2\n\nhttp://pastie.caboo.se/45397
Mar 13, 2007
Tim said...
anyone have a patch to get multi-part activemailer stuff working with themes?
Mar 13, 2007
Tim said...
[Tim:17]
actionmailer that is of course
Mar 21, 2007
Tom said...
Please don't nuke ERB support from Comatose. Am I the only one who hates the look of Liquid templates?
I'd like to be able to pick which processor to use on a per-page basis rather than always using the 'default'.
Mar 21, 2007
Gitte Wange said...
Hi!
I have really enjoyed using the theme_support plugin.
I'm using Rails 1.2.2 now and I have applied the patch supplied by seth (thanks for the url).
The only problem I have left, is to get rails to actually find the layout to be used. The layout I want to use is called 'site'. And I have it present in the in the layouts folder of my layout, I have created the cache so it's in the public dir. I also checked the current_layout which returns the layout var.
But still I get a missing template error. Any idea why?
Mar 27, 2007
Dallas Slieker said...
I have a working copy on theme_support for Rails 1.2.x at http://imaspy.com/news/read/5
Apr 22, 2007
harold said...
Thanks for the notes on getting this to work under rails 1.2.x. I downloaded the files provided by Dallas Slieker, above, and added the suggestion from Ian Duggan, and it seemed to do the trick for me. Thanks.
May 08, 2007
Paolo Angioletti said...
Good job! A lot of thanks to Dallas Slieker for his "theme_support" Plugin For Rails 1.2.x ... and also thanks to Ian Duggan for his very good fixing on layout recognition
Jun 03, 2007
kbas said...
This isn't working on rails 1.2.3..
How I can fix it?
Jun 12, 2007
Greg Moreno said...
Hi guys,
Can anyone here share the patch from Dallas Slieker. His website is down for several days now.
Thanks.
Jun 12, 2007
Dallas Slieker said...
Greg,
Site's up now. Apologies for the inconvenience.
Jun 12, 2007
Greg Moreno said...
Thanks Dallas.
I'm getting this error:
d:/dev/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/routi
ng.rb:954:in `initialize': wrong number of arguments (0 for 1) (ArgumentError)
from d:/dev/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_con
troller/routing.rb:954:in `build'
from d:/dev/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_con
troller/routing.rb:1172:in `add_route'
from d:/dev/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_con
troller/routing.rb:1178:in `add_named_route'
Any ideas why?
Thanks.
Aug 10, 2007
Dave Krupinski said...
I am also having problems with multipart emails. Same problem as Tim. Anybody figured that out?
Aug 12, 2007
sjoker said...
Hi,
I also got the problem using Theme Support on Rails 1.2.3 and ActionMailer views. They just aren't found by pick_template_extension.
search path should be "." (I think so)
does someone know how to make this work? I currently REMOVED theme support just to make my notifiers work again.
thanks in advance
Sep 21, 2007
Bernardo Heynemann said...
Hey Matt,
I posted in my blog on getting the Theme Support Plugin working in version 1.2.3.
Hope it helps someone!
Here it is:
http://manicprogrammer.com/cs/blogs/heynemann/archive/2007/09/21/theme-suppor...
Dec 03, 2007
Andres Montano said...
I love theme_support and use it in several projects.
Nevertheless I have had to fix a couple of things for it to work with rails 1.2.5 ( http://www.gaugeus.com/ramblings/2007/11/4/adding-theme-support-to-a-ruby-on-... ) and for it to support routes with extensions such as rxml ( http://www.gaugeus.com/ramblings/2007/12/3/rendering-templates-extensions-the... ).
Nov 11, 2008
Online Music said...
Great theme, time for more?

Leave a comment...

Theme by Cory Watilo.
More great Posterous themes at themes.posterous.com.