Welcome to Geeklog, Anonymous Wednesday, November 27 2024 @ 09:13 pm EST
Geeklog Forums
Can I use arrays in templates' variables?
Status: offline
LWC
Forum User
Full Member
Registered: 02/19/04
Posts: 818
Geeklog uses a lot of variables like {this} inside its templates.
But what if {this} is an array?
In real time, it just says "Array" (no quotes).
Both {this["index X"]} and {this[index X]} (the first one with quotes, the second one - without) pass "" (empty strings).
Does it just pass the word "Array" or the array itself? I was willing to believe the first choice if only the latter two hadn't returned empty strings, which built my hopes...
I can, of course, just do a "for" loop and pass each index as its own variables, but I just want to make sure there's no way to use arrays in {this} first.
But what if {this} is an array?
In real time, it just says "Array" (no quotes).
Both {this["index X"]} and {this[index X]} (the first one with quotes, the second one - without) pass "" (empty strings).
Does it just pass the word "Array" or the array itself? I was willing to believe the first choice if only the latter two hadn't returned empty strings, which built my hopes...
I can, of course, just do a "for" loop and pass each index as its own variables, but I just want to make sure there's no way to use arrays in {this} first.
6
8
Quote
ted
Anonymous
reading the comments in the template class file will give you more of an idea about why that won't work. basically, the template class will not parse that placeholder, but will only replace it with output set before the template object is parsed... something like that.
btw, any text within the curly braces that is not set in the template object will return empty strings. Leave the text out and you'll just get curly braces.
btw, any text within the curly braces that is not set in the template object will return empty strings. Leave the text out and you'll just get curly braces.
27
7
Quote
All times are EST. The time is now 09:13 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content