require 'config/environment'
parent = Page.find_by_url('/path/to/parent')
50.times do {|i|
child = Page.new
child.parent = parent
child.title = "Page #{i}"
child.breadcrumb = "Page #{i}"
child.slug = "page-#{i}"
body = PagePart.new
body.content = "This is page #{i}"
child.parts = body
child.save!
}
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> Saji Njarackalazhikam Hameed
> Sent: Wednesday, 16 May 2007 2:17 PM
> To: [email protected]
> Subject: Re: [Radiant] automated page building
>
> Dear Sean,
> Thank you for the tips. I am comfortable with writing shell or
> Ruby scripts for this task, but have no idea of the inner workings of
> Radiant. I have briefly looked at the Capistrano manuals and it
> is a possible tool for my purpose.
> If there is an example showing how to use scripting (ruby/bash) for
> this kind of job, I would be grateful to learn from it.
>
> Thanks,
> saji
>
> * Sean Cribbs <[EMAIL PROTECTED]> [2007-05-15 20:55:25 -0700]:
>
> > You could write a Ruby script that you invoke with script/runner, or
> > better yet, a Rake task. It will require some knowledge of
> the inner
> > workings of Radiant (at least how the models interact).
> > Alternatively, if you're not comfortable with using the shell,
> > Capistrano could help you automate this, especially if the
> images are
> > local and not from external service.
> >
> > Sean
> >
> > On 5/15/07, Saji Njarackalazhikam Hameed <[EMAIL PROTECTED]> wrote:
> > > Dear All,
> > >
> > > I started using Radiant and appreciate much its elegant
> interface. As
> > > a user I find it easy to use the Radiant interface for creating
> > > new pages and developing complex webpages with minimal effort.
> > > I wonder if there is a way to create certain pages automatically
> > > using some kind of script.
> > >
> > > The situation is that we have weekly updates to our
> climate monitoring
> > > webpage. For this, about 50 images have to be uploaded to the site
> > > and the corresponding pages built every week. Wonder if
> Radiant could be
> > > provided instructions to do this using a script than a
> person sitting
> > > and typing it all in.
> > >
> > > Thanks for any pointers,
> > > saji
> > > --
> > > Saji N. Hameed
> > >
> > > APEC Climate Center
> +82 51 668 7470
> > > National Pension Corporation Busan Building 12F
> > > Yeonsan 2-dong, Yeonje-gu, BUSAN 611705
> [EMAIL PROTECTED]
> > > KOREA
> > > _______________________________________________
> > > Radiant mailing list
> > > Post: [email protected]
> > > Search: http://radiantcms.org/mailing-list/search/
> > > Site: http://lists.radiantcms.org/mailman/listinfo/radiant
> > >
> > _______________________________________________
> > Radiant mailing list
> > Post: [email protected]
> > Search: http://radiantcms.org/mailing-list/search/
> > Site: http://lists.radiantcms.org/mailman/listinfo/radiant
>
> --
> Saji N. Hameed
>
> APEC Climate Center +82 51 668 7470
> National Pension Corporation Busan Building 12F
> Yeonsan 2-dong, Yeonje-gu, BUSAN 611705
> [EMAIL PROTECTED]
> KOREA
> _______________________________________________
> Radiant mailing list
> Post: [email protected]
> Search: http://radiantcms.org/mailing-list/search/
> Site: http://lists.radiantcms.org/mailman/listinfo/radiant
>
_______________________________________________
Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant