Avatar of Bruce Gust
Bruce Gust
Flag for United States of America

asked on 

What does this error mean and how can I fix it?

Here's the portion of my twig file that has me baffled...

 <div class="collapse" id="act-{{activity._id}}">
                {% for key, val in activity.meta %}
				<div class="box-item">
				<strong>{{key}}</strong>:<span>{{val}}</span>
				</div>
                {% endfor %} 

Open in new window


I know that doesn't look like much, but I'm still new to this so it doesn't take much to get me to a place where I'm scratching my head.

In any event...

That "for" loop is what's feeding the "date" and the "notes" that you see below.

screenshot
What I need to do is reformat that date. So, my plan is to grab the date as it's coming in, reformat it and then print it. So, the first step is to grab the date and I tried this (code in bold):

 {% for key, val in activity.meta %}
				<div class="box-item">
					[b]{% if key=="date" }}
					good times
					{{ %endif %}}[/b]
					<strong>{{key}}</strong>:<span>{{val}}</span>
				</div>
                {% endfor %} 

Open in new window


When I did that, I got this error:

Error compiling twig template C:\wamp64\www\bSmart\views\partials\company-slide-out\history-tab.html.twig:
TwigException: Twig.expression.type.variable cannot follow a Twig.expression.type.object.end at template:13 near 'good...'

What does that mean and how can I fix it?
Node.jsJavaScript

Avatar of undefined
Last Comment
Alex [***Alex140181***]

8/22/2022 - Mon