Structure title and model acquirement

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

Structure title and model acquirement

NorbertHartl
My pier setup stabilizes a bit. I was able to reproduce
a few page layouts of our project and integrated some
components. At the moment I really love it as most of
the things I wanted worked out today.

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?

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?

thanks in advance,

Norbert


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

Re: Structure title and model acquirement

Lukas Renggli
> 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.

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.

> 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?

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: Structure title and model acquirement

NorbertHartl
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


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

Re: Structure title and model acquirement

Lukas Renggli
>> Simply not displaying the title can be achieved by chaining the environment.
>>
> Can you please elaborate on that?

If you use the latest template from Doru then the line
<h1>+value:structure+</h1> adds the title.

Older versions of Pier displayed the page title through the setting
"Heading" in the content widget. Simply leave that empty to not emit
the title.

> 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?

Have a look at the senders of #title in Pier-Model. It is probably not
essential, but there are quite a few users.

> 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.

What I suggested does not alter Pier, it just alters the meta-model.

Lukas

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

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