PRCase and custom pages (template)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

PRCase and custom pages (template)

Lautaro Fernández
Hello,
I want to know if it possible to create some sort of template, in which if I create a page it will add other XYZ pages inside of it.
For instance, I want to create a PageProject so that page have 3 other sub pages:
MyProject
 ->Installation
 ->Wiki
 ->FAQ

I could do something like:
PageProject>>defaultDocument
    ^ super defaultDocument
        add: (PRParagraph new
            add: (PRText content: '*Installation* *Wiki* *FAQ*');
            yourself);
        yourself

But the problem is that those 3 pages aren't created, I have to click on each link and then accept to make them "alive".

So, here is my question:
Is there any way to create dynamically pages inside a newly page(the one I just had created)?

Notes:
I'm working with VisualWorks, and therefore the Pier versions are probably quite old :(
Is somebody working on the port of the latest Pier version into VisualWorks?

Thanks in advance,
Lautaro Fernández
--
Luke LAut SkyFernadezWalker


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: PRCase and custom pages (template)

Lukas Renggli
> So, here is my question:
> Is there any way to create dynamically pages inside a newly page(the one I
> just had created)?

I would override PageProject>>#initialize and add the subpages
programmatically. Something like:

PageProject>>initialize
    super initialize.
    self addChild: (PRPage named: 'installation').
    self addChild: (PRPage named: 'wiki').
    self addChild: (PRPage named: 'faq').

You can also change the document contents, title and other properties
from there if you want.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: PRCase and custom pages (template)

Lautaro Fernández
Thanks for your quickly response!
A friend tried (but it was a bit more ugly code) to do the  "addChild: (PRPage ...)" in the defaultDocument and it also works.

But initialize seems to be a better place.

Sorry for make the same question again, is somebody making the port of Pier into VisualWorks?
The latest published version is from 10/2007, and the Pier version is lr.183-222-81-99 CS12NFR.10

Thanks again,
Lautaro Fernández

2009/2/13 Lukas Renggli <[hidden email]>
> So, here is my question:
> Is there any way to create dynamically pages inside a newly page(the one I
> just had created)?

I would override PageProject>>#initialize and add the subpages
programmatically. Something like:

PageProject>>initialize
   super initialize.
   self addChild: (PRPage named: 'installation').
   self addChild: (PRPage named: 'wiki').
   self addChild: (PRPage named: 'faq').

You can also change the document contents, title and other properties
from there if you want.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki



--
Luke LAut SkyFernadezWalker


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki