Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
goldmorphin Posted November 6, 2017 Posted November 6, 2017 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"> <tr> <th>Name</th> <th>Description</th> </tr> {{foreach $array as $param => $value}} <tr> <td> <code>{$param}</code> </td> <td>{$value}</td> </tr> {{endforeach}} </table> {{endforeach}} 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?
bfarber Posted November 7, 2017 Posted November 7, 2017 For testing, try {{$key = "api_" . $langKey;}} {lang="$key"} Without firing up a test instance it's hard to confirm, but interpolating the { and } inside the plugin tag may be confusing the template parser.
Aiwa Posted November 7, 2017 Posted November 7, 2017 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> </a> </li> {{endforeach}}
Recommended Posts
Archived
This topic is now archived and is closed to further replies.