Hi all,

my biggest problem as a new midgard 1.4 user is:

I don't really understand the concept behind it and I could not find a document 
describing it. In particular, I don't know what of the features is PHP and what 
is midgard.

My current understanding of how it works is:

For every page hit, midgard has the midgard-root.php3 document and the URL.

1. It finds the page document corresponding to the URL.

2. It finds the style associating with this document.

3. The style contains macro blocks of the form <[name]>, which can contain HTML 
or PHP code or other <[name]> macros. Midgard collects references to these 
blocks. If a style is a child style, then also the macros of its parent style 
are collected, and so on up to the top.

4. Midgard then replaces the <[name]> macros in the midgard-root.php3 with the 
actual text. The midgard-root.php3 has one <[ROOT]> macro, therefore every page 
must have at least one style with a <[ROOT]> macro, otherwise we would have no 
HTML text at all.

5. Following that Midgard replaces any macro of the form <(content)> with the 
content of the field named "content" of the page object found in step 1

6. The resulting HTML/PHP mix is then fed to Apache, which takes care of the 
rest.


Ok, so far I understand the thing. Now here are the unanswered questions:

What are the <(name)> macros? It looks as if these are fields of a midgard 
object, but is it always from the Page object or can it be another object like 
Article, Style, Topic? If the $object->name field is emtpy, will midgard look 
for this variable in other objects?

Which of these <(name)> macros are available? Or can I simply use all fields of 
a particular object?

How do page elements fit in this model? I noticed that macros of the form 
<[page-element-name]> reference the code in the page element when used in a 
style, just like other style elements, but what is the purpose? What are the 
differences?

One last question: Can I set the style for a page dynamically somehow? I have 
an active page of the form /topic/, which uses one style, and the pages of the 
form /topic/article123.html should use another style. Currently I have merged 
both styles into one style document and I select the appropiate one with an "if 
($flag) {" construction, but this does not feel right. I would rather like to 
set the style explicitely in the piece of code where I handle the argv[] 
arguments.

Aside from these questions, I like Midgard very much.... thanks for making it.


Arne



 

--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org

To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]

Reply via email to