Francois Dumais wrote: > Why is it, that one would find "code-global" and "code-init" under the > Asgard style and not under UNIQUELY under the Asgard root page?
Both normal elements, and the initialization elements (code-init, etc) can reside under either pages or styles. If they are under pages, they will be available to only that page (or if marked inherited, to that page tree). If they are under a style, then they are available to all pages/hosts using that style. > I tought scripts were only to be found as page elements under pages... isn`t > that what is said in the manual? > > Isn't that an example of bad design? (I am not hunting witches but just > making discussion points) Depends on your design philosophy. If you want your styles to only contain layout information, and no actual programming logic, then this would be bad design. However, the key point in Midgard is that it really doesn't force you to adher to a specific design philosophy, but rather enables to utilize all building blocks of the API as you wish. Sometimes this results to messy code, and sometimes it results to clever new kinds of implementations. > If I refer to the manual, it explains the walking through of pages (down the > tree) and walking up the style tree. Now if one looks in the page tree for > Asgard root, one sees amongst other things the "code-init" page element. > What is said in the manual is that page elements will always "override" the > style element. Am I right, here? > > So, does it mean that the first "code-init" will never get used? Yes. At least, the code-init provided in the style won't be used for that specific page (or tree of pages), but is still used elsewhere. You can override any element in Midgard. If you want to override your whole style in a specific page, just create a page element called ROOT. > Does it mean that *in principle" one coud get rid of it, if and only if, one > is sure that no other inherited styles will ever need it? Yes. > I also gathered from the manual that the "execution" will only start ONCE > both the page tree and the style tree have been walked through ... yes? > > I also gathered from the manual that things will get executed in the > following order: "code-compat", "code-global", "code-init", and finally > ROOT, using the filled Apache variable, am I right? Yes. You can see this by looking at the midgard-root.php file provided in the midgard-data package. This is the actual PHP file that gets executed for each request served by Midgard. > So, when it meets "<(content)>" in the <[table]> element, to what "content" > does it refer to? <snip> > Or is <(content)> referring to the "content" text > box in the page properties form???? Yes. Besides <(content)> you also have <(title)> which refers to the "title" field in page properties. In old Midgard versions, you used to call in page and style elements by <[element]> and the page properties by <(property)>, but we desided to allow usage of both notations in both cases for simplicity. /Bergie -- Henri Bergius [EMAIL PROTECTED] Consultant Partner Tel: +358-20-198 6032 Nemein Solutions Oy http://www.nemein.com Nadmin Studio and Midgard support at 0600-1-2552 available for Finnish customers. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
