[typo] new blog / routes.rb Q
Ian Holsman
lists at holsman.net
Mon Sep 26 23:37:41 EDT 2005
Michael Purvis wrote:
> This looks like arbitrary-depth sub-categories, and I wouldn't know how
> to do that purely with routing.rb, unless you wanted a whole pile of
> really awkward rules.
>
> What's needed is a rule where the entire path after point X gets passed
> to the action as an array, and then the action can go about crunching it.
>
> Of course, if you want something extraordinarly goofy, you could put a
> mod_rewrite rule directly in your .htaccess which just converts all
> slashes to underscores, so that your mega-path:
> http://leisurelearning.com.au/f/Buki+Toys/Developmental+Products/Near+And+Far/688
>
thats similar to what I do today.. but I just remove the stuff ;-) I was
trying to avoid rewrite.. but it looks like you can't.
> Looks to Rails like:
> http://leisurelearning.com.au/f/Buki+Toys_Developmental+Products_Near+And+Far/688
>
> However, I'm sure someone here would have a better solution. (And of
> course, remember that Typo is a blog engine, not a CMS. I don't know of
> any particularly interesting rails-CMS projects at the moment, outside
> of Amy Hoy's one... but that hasn't seen a release yet, just a screenshot)
>
> Mike
>
I pinged Amy to see if she's gone any further with it (I hope so.. it
looks nice).
A IRC member pointed also me to http://handsgallery.com/ where typo is
being used as a basic CMS... which looks perfect for what I need for a
couple of other things...
>
> Ian Holsman wrote:
>
>> on this note, is it possible for typo/rails to ignore part of the path?
>>
>> for example
>> http://leisurelearning.com.au/f/Buki+Toys/Developmental+Products/Near+And+Far/product_id=688
>>
>> I'd like rails/typo to be able to ignore the parts between 'f/' and
>> '/product_id'.
>>
>>from what the example you give below it seems like I can.
>> regards
>> Ian.
>>
>>
>> Mike Purvis wrote:
>>
>>
>>> Looks nice. A similar look to what I was trying to acheive
>>> (http://uwmike.com), but I think you did a much better job.
>>>
>>>
>>> By the way, if you don't like the /pages/x URLs, it's a reasonably easy
>>> hack on /typo/config/routes.rb to make them... something else. Around
>>> like 80, you'll see:
>>>
>>> map.connect 'pages/*name',:controller => 'articles', :action => 'view_page'
>>>
>>> Now, it's an easy thing to make "pages" something else, but you can also
>>> just add a rule like
>>>
>>> map.connect 'bio',:controller => 'articles', :action => 'view_page',
>>> :name='bio'
>>>
>>> That way "/pages/bio" and "/bio" will both be the same resource...
>>> Anyhow, not a big deal, but it's kind of cool. (The
>>> http://uwmike.com/about page on my site is like this...)
>>>
>>> Cheers.
>>>
>>> Mike
>>>
>>>
>>>
>
>
More information about the Typo-list
mailing list