OK, I see the Velocity reason now: http://velocity.apache.org/engine/releases/velocity-1.7/user-guide.html#index, in their given example: $foo.callMethod()[1] , foo.callMethod() could return a List or an Array, for which the [1] would mean retrieve the first element from. So yes, if we don't want [$commentCount] to be treated as an index we need a space or the "formal reference notation" { } as you list below. I'll get a patch ready to fix the optional templates.

Thanks,
Glen


On 11/21/2013 08:28 PM, Glen Mazza wrote:
Thanks Greg. Is this a Roller bug or just the way Velocity (now) is? I assume the latter...

Glen

On 11/21/2013 03:02 AM, Greg Huber wrote:
Glen,

Remember this from a while back, it needs a space or you could escape it
with {} notation.

eg

$text.get("macro.weblog.comments") [$commentCount]

or

${text.get("macro.weblog.comments")}[$commentCount]

Cheers Greg


On 17 November 2013 12:49, Glen Mazza <[email protected]> wrote:

Hi Team,

I'm trying to use the "Rolling" theme (http://code.google.com/a/
apache-extras.org/p/roller-extras/wiki/Themes) on Roller trunk, it seems to work fine except for one issue. Here's the standard 5.1 Basic theme's
code (simplified) for the "Comments[x]" portion for a blog entry:

<a href="$url.comments($entry.anchor)" class="commentsLink">$text.get("macro.weblog.comments")
[$commentCount]</a>
(Note the single space right before the [$commentCount])
works fine: Comments [0] <http://localhost:8080/roller/
blogtwo/entry/test_blog_article#comments>

The Rolling theme has this:
<a href="$url.comments($entry.anchor)" class="commentsLink">$text.
get("macro.weblog.comments")[$commentCount]</a>
(No space before the [$commentCount])
fails, outputs: $text.get("macro.weblog.comments")[$commentCount] <
http://localhost:8080/roller/blogtwo/entry/test_blog_article#comments>

If I insert the space in the Rolling theme, it works fine with Roller
trunk. I also tested this with Roller 3.1 and both the versions with and
without the space work fine.  Is there a bug in the Roller trunk parser
that incorrectly makes it require a space between $text.get("macro.weblog.comments")
and [$commentCount] (I would guess) or is there now a requirement for a
space between fields, and the Roller alternate themes need updating as a
result?

Thanks,
Glen




Reply via email to