Forum: Ruby on Rails Template Language for a CMS

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C4cd024191ff30fb901592e63d9ef820?d=identicon&s=25 DAZ (Guest)
on 2009-01-25 20:02
(Received via mailing list)
How would you go about creating a template language that could be used
to allow access to *some* helpers for a CMS-style app?

For example if there is a text field called content, I can use Textile
or (my preference) Markdown to allow easy html generation, but they
don't allow for any conditional markup based on the page. Is there any
way to extend these languages by allowing access to some of the helper
methods.

I was thinking something like:

% image(bart.png) %

% breadcrumbs %

% nav_menu(child_pages) %

Does something like this exist? Would it be better to try to extend
markdown or write one from scratch? How would you go about writing
one?

cheers,

DAZ
7bf65dcb7e862416161ea9bb591c2d8d?d=identicon&s=25 Macario Ortega (macario)
on 2009-01-25 20:19
DAZ wrote:
> How would you go about creating a template language that could be used
> to allow access to *some* helpers for a CMS-style app?
>
> For example if there is a text field called content, I can use Textile
> or (my preference) Markdown to allow easy html generation, but they
> don't allow for any conditional markup based on the page. Is there any
> way to extend these languages by allowing access to some of the helper
> methods.
>
> I was thinking something like:
>
> % image(bart.png) %
>
> % breadcrumbs %
>
> % nav_menu(child_pages) %
>
> Does something like this exist? Would it be better to try to extend
> markdown or write one from scratch? How would you go about writing
> one?
>
> cheers,
>
> DAZ


Have you checked liquid? There is a nice screen cast @ railcasts:
http://railscasts.com/episodes/118-liquid
C4cd024191ff30fb901592e63d9ef820?d=identicon&s=25 DAZ (Guest)
on 2009-01-26 11:46
(Received via mailing list)
Thanks  Macario,

Liquid looks like what I'm after - and the railscast (as always) is
excellent. It seems like I could hook some specific helper methods up
to it and they could be outputted using {{ this notation }}

Out of interest ... how does one go about writing their own template
language? Any basic way of starting?

cheers,

DAZ





On Jan 25, 7:19 pm, Macario Ortega <rails-mailing-l...@andreas-s.net>
This topic is locked and can not be replied to.