Frank Boehme wrote:
> I know, this is not a big issue, but anyway:
> 
> It would be nice if there was a way to set a default inclusion type for
> each article so that
> 
>   &(article.content);
> 
> expands to verbatim, php, html on the fly, etc, depending on a new field
> for each article which can be set in the admin interface. The syntax
> 
>   &(article.content:x);
> 
> could still be used to overwrite this behaviour.
> 
> My view is that each content is _meant_ to be included in one way only.
> The type of expansion is some sort of an inherent feature of each
> individual article.
&(object.record:type); is general Midgard's construct and is not
directly connected only with articles. That's why the default behaviour
of &(); statement is simply to display content of its argument 'as is'
without any conclusions about its nature.

Moreover, CVS version of Midgard (codename 'Bifrost') now has additional
feature in this statement: if argument is an array, then you can use any
indexing variable to access array's elements:
<? $foo = array('a', 'b', 'c', 'd', 'e');
    for ($i=0; $i<5; $i++) {?>
&(i);: &(foo.i);<br>
<?  } ?>

will display

0: a
1: b
2: c
3: d
4: e
 
> Right now, whenever I change pages, I have to look under content admin
> first, to check which way the articles are written. Non-technical users
> are instructed to write their articles so that I can use :t and my own
> articles are meant to be used with different specifiers. But I have to
> be aware of this whenever I change pages.
You can use extra fields in an artcile for storing content's type and
use this value later when content should be displayed:
<? $article = mgd_get_article(some_id);
   if($article->extra1 != '') {
     eval("?>&(article.content:" . $article->extra1 . "); <?");
   } else { ?>
&(article.content); <?
   }
?>

--
Alexander Bokovoy

--
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