Jump to content

Template error when I use variables in lang tags


Recommended Posts

Hello! I have weird problem with this code:

{{foreach $user['general'] as $key => $array}}

<h3 class="ipsType_sectionHead ipsSpacer_bottom ipsSpacer_half">{lang="api_{$key}"}</h3>

<table class="ipsTable">
  {{foreach $array as $param => $value}}

when I'm try to use {lang="api_{$val}"} - its working for <h3> element and I see translated text, but next foreach doesn't work and all rows is empty.

But when I put something like:

<h3 class="ipsType_sectionHead ipsSpacer_bottom ipsSpacer_half">{$val}</h3>

all code in template is working fine. Why it's happening? What I'm doing wrong?

Link to comment
Share on other sites

I'd first check your data structure you're looping through. I'm doing something almost exactly the same, and it works without issue. 

{{foreach $member->bf4 as $plat => $data}}
				<li class="ipsMenu_item">
					<a href="{url='...' csrf='true'}">
						<span>{lang="bf4_{$plat}"}: {datetime="$data->last_update" short="TRUE"}</span>


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...