On 26 Dec, Jamie Tomlinson wrote:
> Small problem. I am trying to have a "menu" list articles and then
> present them when clicked. So far, I've done it by passing a variable
> &($article.id) to the page and have it server up the content. The
> problem I'm running into is that the first item on the list is alwasy
> presented with a dollar sign in front of it (so is the id #). The code
> and output are listed below:
<snip>
> ?><li><a href="/about/?id=&($article.id);">&($article.title);</a>
Ok, that is the problem there. The syntax for accessing
variables in PHP scripts and outside them in Midgard's
own variable substitution system differ a bit.
In PHP scripts, the correct syntax is $object->variable
but when substituting these outside PHP script in Midgard,
the syntax is &(object.variable);
So the line there should be:
?><li><a href="/about/?id=&($article.id);">&($article.title);</a>
However, the problem you had may be revealing a bug
in Midgard's language scanner - I think the correct
behavior with this kind of syntax problem should be
an error message.
> Jamie
/Bergie
--
-- Henri Bergius -- +358 40 525 1334 -- [EMAIL PROTECTED] --
http://www.iki.fi/Henri.Bergius
--
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]