Dynamically placing components on a page

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

Dynamically placing components on a page

Petr-9
Hello Seasiders,

I am working on an application, where the user should have the
possibility to add and remove components from the page at runtime. More
or less it should be a wiki, where each page can contain not only text,
but also WAComponents, which the user can place into the page using some
XML tags. The closest similar application is the google's personalized
homepage (http://google.com/ig).
The user is supposed to click on a link on the page and the edit a XML
code which contains the description of the content of the page and then
just save it.
I parse the content of the XML and generate the page accordingly. My
problem is when the page is edited and newly rendered, I overwrite the
array returned by MyPage >> #children with the list of the new
components, which is probably not what I am supposed to do, because when
I do this, calling other components doesn't work (any link which is
supposed to call another component just doesn't do anything).
So my question: Is there a way how the user can add/remove components on
a page at dynamically without breaking anything?

Bye
Petr

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Dynamically placing components on a page

Lukas Renggli
> I am working on an application, where the user should have the
> possibility to add and remove components from the page at runtime. More
> or less it should be a wiki, where each page can contain not only text,
> but also WAComponents, which the user can place into the page using some
> XML tags. The closest similar application is the google's personalized
> homepage (http://google.com/ig).

Have a look at Pier. This CMS and Wiki allows users to embed Seaside
components into any page. Also the templates (the look and feel of the
web site) are built by editing a Wiki page and embedding components.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Dynamically placing components on a page

Philippe Marschall
In reply to this post by Petr-9
2007/6/15, Petr <[hidden email]>:

> Hello Seasiders,
>
> I am working on an application, where the user should have the
> possibility to add and remove components from the page at runtime. More
> or less it should be a wiki, where each page can contain not only text,
> but also WAComponents, which the user can place into the page using some
> XML tags. The closest similar application is the google's personalized
> homepage (http://google.com/ig).
> The user is supposed to click on a link on the page and the edit a XML
> code which contains the description of the content of the page and then
> just save it.
> I parse the content of the XML and generate the page accordingly. My
> problem is when the page is edited and newly rendered, I overwrite the
> array returned by MyPage >> #children with the list of the new
> components, which is probably not what I am supposed to do, because when
> I do this, calling other components doesn't work (any link which is
> supposed to call another component just doesn't do anything).

#children must return all the (direct) child components. Also remember
to backtrack them correctly else you break the back button.

Cheers
Philippe

> So my question: Is there a way how the user can add/remove components on
> a page at dynamically without breaking anything?
>
> Bye
> Petr
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Dynamically placing components on a page

Petr-9
Hi,
> #children must return all the (direct) child components. Also remember
> to backtrack them correctly else you break the back button.

that is exactly what I did wrong :), I have broken the back button...
Either way, thank you both for the answers, I thought Pier might include
exactly what I want, though using the whole Pier codebase is overkill
for my needs, so I will just have a look how exactly I should implement
this.

Petr

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Dynamically placing components on a page

Jason Johnson-3
Petr wrote:
> I thought Pier might include exactly what I want, though using the
> whole Pier codebase is overkill for my needs, so I will just have a
> look how exactly I should implement this.
>
> Petr

I wouldn't be so fast to assume this.  You don't want to get in a
situation where after working on it for 5 years you finally get to the
point where you have implemented everything Pier has today.  As far as I
understand, Pier is a CMS made to be used at customer sites (i.e. not
just software made to show off seaside features), and therefor probably
has the things you will end up building.

What I personally do to create my site(s) is just use Pier and create
components that do the specific behavior I want.  Most things I end up
doing fit really well with how Pier already works.  E.g. on the band
site, there is a section that tells about all the band members.  The
band is 5 people, and pretty static, but I still found it faster to just
make a really simple Pier component that has the fields and is set up so
that a new member can be added by saying "add->component->band member"
and then use the Pier settings button to fill in the fields.  A kind of
DSL if you will. :)
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside