On Mon, 2009-03-02 at 08:30 +0100, Lukas Renggli wrote:
One thing that
I want to change is the title of a structure.
I don't want to have it as not all pages have titles and the
others deal differently with something like a title. So why
is the title mandatory for a structure? Is there an easy way
to get rid of it?
Simply not displaying the title can be achieved by chaining the environment.
Can you please elaborate on that?
You can also try to change the description of the
title in
PRStructure, but that might break parts of Pier that depend on the
fact that every structure has a title.
- If you want to change, replace or remove the title for your own
subclasses override #descriptionTitle on the class side.
- If you want to change, replace or remove the title from all
structures add a class side extension method like #descriptionTitle:
(that shares the same prefix, but with one argument). This method is
automatically called by Magritte and allows you to change (return a
modified description), replace (return a new description) or remove
(return nil) the description.
I don't understand what title is used for. What is the reason that
_every_ structure has to have a title? Is pier doing something
special with it?
Beside that I don't really care if the title is there or not as long
as I'm not forced to use it. And altering pier so that it doesn't
display the title is a weak option. But I'll have a look into it.
Or is there a better option when I want to have a page that contains
only three components without an displayed title?
Navigating to
a page, pressing edit and just integrate a
component by doing +...+ is really great! But I'm asking myself
what is the best way to acquire the data the component needs.
As an example I have a user and the user has a list of images.
I have a component that takes a list of images and displays them.
In my current approach these are connected via Announcements.
Whenever the user changes the image list component gets his model
set to the new list of images. What is the best way to decorate a
component with some functionality?
The settings of that component?
Yes, the setting that whenever something happens the component gets
its model set again. I could do this with asking inside the component
self session context owner images
But then I'm starting bring a lot of knowledge from the outside into
the component. I would rather have some glue code anywhere that does
this.
thanks,
Norbert