PDA

View Full Version : contentitem without contentcontainer in skin ?



erland
2008-01-03, 03:32
A question regarding the components available when developing plugin pages for the web interface.

In the cmdwrappers file there are two blocks defined called:
- contentcontainer
- contentitem

I tought these always was required to be used together so you for example have code like this:


[% WRAPPER contentcontainer %]
[% FOREACH item IN itemList %]
[% WRAPPER contentitem %]
[% item.text %]
[% END %]
[% END %]
[% END %]


However, I just noticed that the RandomPlay plugin uses a contentitem directly without wrapping it in a contentcontainer. The positive result of this is that it makes it possible to display contentitem's on part of the page, if you place it inside a contentcontainer the default skin resizes the container so it covers the whole page.

Is it supported to use contentitem this way ?
Does this also mean that skin developers can't rely on the fact that the contentitem is wrapped inside a contentcontainer ?

pippin
2008-01-03, 03:37
Can only answer for iPeng: You are supposed to use contentcontainer. If you omit it, it looks like RandomPlay ;-)
You CAN omit it if you wrap it in a <table>, however that would be a skin specific assumption about the behavior of contentitem which generally is a bad idea as of my experience with iPeng.
But must plugins do this kind of stuff, RandomPlay is one of them.

mherger
2008-01-03, 03:44
> However, I just noticed that the RandomPlay plugin uses a contentitem
> directly without wrapping it in a contentcontainer. The positive result

Where do you see this? I see the container as a big wrapper around the calls to the contentitem wrappers.

Michael

erland
2008-01-05, 02:36
> However, I just noticed that the RandomPlay plugin uses a contentitem
> directly without wrapping it in a contentcontainer. The positive result

Where do you see this? I see the container as a big wrapper around the calls to the contentitem wrappers.

Michael

In Slim/Plugin/RandomPlay/HTML/EN/plugins/RandomPlay/list.html

It contains a directive "[% WRAPPER contentitem %]" but it doesn't contain any surrounding "[% WRAPPER contentcontainer %]".

Or am I missing something ?

The question was if it is okey to use "[% WRAPPER contentitem %]" without also surrounding it with a "[% WRAPPER contentcontainer %]" ?

mherger
2008-01-05, 08:58
> In Slim/Plugin/RandomPlay/HTML/EN/plugins/RandomPlay/list.html

Sorry... I spent too much time with the playlist templates. You're right,
it seems to be lacking from that template.

> The question was if it is okey to use "[% WRAPPER contentitem %]"
> without also surrounding it with a "[% WRAPPER contentcontainer %]" ?

I would have said you shouldn't, as skins might rely on inherited
templates. But as it looks it's working anyway...

Michael

erland
2008-01-05, 09:28
I would have said you shouldn't, as skins might rely on inherited
templates. But as it looks it's working anyway...

So does this mean that skin developers can't rely on that a contentitem is wrapped inside a contentcontainer ?

Or should I write a bug report on it so it gets fixed in the Random Mix plugin page eventually, which currently looks like a mess in the iPeng skin due to this ?

mherger
2008-01-07, 05:27
> Or should I write a bug report on it so it gets fixed in the Random Mix
> plugin page eventually, which currently looks like a mess in the iPeng
> skin due to this ?

Added the wrapper in 15949 - it was breaking Default too, though only visibly in IE6...