Witaj Rogaty,
On Sun, 29 Jul 2001, Rogaty wrote:
> Is it possible to dynamically change to different style on one
> page.
> I have one root style and a child style with elements that would
> override those from root style.
> On one (active) page I want to have root style for article listing
> and child style for one article. How to do it in midgard?
> I cannot use page-elements, it's out of the question (i think).
There is no 'native' way to do this, but you can use tricks to do
something similar:
<[ROOT]> :
<?php
if(argc==0) { /* assuming that no arguments on the active page
will do the article listing */
?><[list-ROOT]><?php
} else if(argc==1) { /* assuming that 1 argument will display
one article */
?><[article-ROOT]><?php
} else { /* do error handling of 'bad' URLs */ }
?>
The bad thing is, is that you will have to fully specify all elements
under list-ROOT and article-ROOT, and can not enjoy the benefits of a real
child-style, overriding just the elements you'd want to be different.
You probably could think of a similar trick using page-elements, not
working all the way from the ROOT element but from the element you'd like
to override. So if the rootstyle has <[display]> as the element that is to
be different for the active page depending on listing or one-article
display, you could create a page-element <[display]> for that page like:
<[display]>
<?php
if(argc==0) {
?><[display-list]><?php
} else if(argc==1) {
?><[display-one]><?php
} else {
?><[error]><?php
}
?>
display-list, display-one, and error would then be page-elements that get
included on demand by the display page element.
Just some thoughts, hope it helps.
--
Envida http://www.envida.net/
Armand A. Verstappen Graadt van Roggenweg 328
[EMAIL PROTECTED] 3531 AH Utrecht
tel: +31 (0)30 298 2255 Postbus 19127
fax: +31 (0)30 298 2111 3501 DC Utrecht
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]