Hi,
Rustam Ustjuzhanin wrote:
> I am very interesting about using code property in topic object.
> How to use this feature? I can't find any mention about it on
> midgard site.
It's a generic TEXT field, nothing special about it. The normal use of
the field is to store some topic-specific PHP code in it and then either
evaluate (just code) or include (code embedded in html) it in the
generated page when the topic is accessed. The Midgard Project web site
uses the field to set certain variables and classes that affect the
outlook and behaviour of the sections of the site mapped to the topic
subtree.
A simple example would be to first initialize a common article sort
order for the topic and then allow the topic code field to override it:
code-init:
<?php
$SORT_ORDER = "reverse created";
if ($argc == 1 && mgd_is_in_topic_tree($argv[0], $ROOT))
$topic = mgd_get_topic($argv[0]);
if ($topic && $topic->code)
eval($topic->code);
?>
$topic->code:
$SORT_ORDER = "reverse score";
Jukka
--
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]