Post by Former Member on Jan 28, 2019 23:51:23 GMT -8
It wont let me save a template because there are too many foreach loops, is there a way around this or to extend this? This is how my coding is set up, I have roughly 30 custom fields, the second lot of code is my attempt at trying to reduce foreachs but it made everything go haywire.
<td><div style="margin-top:4px;width: 80px; height: 18px; overflow: auto; padding: 4px; border: solid 2px #000000; background-color: #393c4d;">{foreach $[post.created_by.custom_field]}
{if $[post.created_by.custom_field.name] == "First Race"}$[post.created_by.custom_field.value]
{/if}{/foreach}</div></td>
<td><div style="margin-left:13px;margin-top:4px;width: 59px; height: 18px; overflow: auto; padding: 4px; border: solid 2px #000000; background-color: #393c4d;">{foreach $[post.created_by.custom_field]}
{if $[post.created_by.custom_field.name] == "First Gender"}$[post.created_by.custom_field.value]
{/if}{/foreach}</div></td>
<td><div style="margin-left:6px;margin-top:4px;width: 30px; height: 18px; overflow: auto; padding: 4px; border: solid 2px #000000; background-color: #393c4d;">{foreach $[post.created_by.custom_field]}
{if $[post.created_by.custom_field.name] == "First Age"}$[post.created_by.custom_field.value]
{/if}{/foreach}</div></td>
<td><div style="margin-left:-31px;margin-top:4px;width: 102px; height: 18px; overflow: auto; padding: 4px; border: solid 2px #000000; background-color: #393c4d;">{foreach $[post.created_by.custom_field]}
{if $[post.created_by.custom_field.name] == "First Profession"}$[post.created_by.custom_field.value]
{/if}{/foreach}</div></td>
<td>{foreach $[post.created_by.custom_field]}<div style="margin-top:4px;width: 80px; height: 18px; overflow: auto; padding: 4px; border: solid 2px #000000; background-color: #393c4d;">
{if $[post.created_by.custom_field.name] == "First Race"}$[post.created_by.custom_field.value]{/if}
</div></td>
<td><div style="margin-left:13px;margin-top:4px;width: 59px; height: 18px; overflow: auto; padding: 4px; border: solid 2px #000000; background-color: #393c4d;">
{if $[post.created_by.custom_field.name] == "First Gender"}$[post.created_by.custom_field.value]{/if}
</div></td>
<td><div style="margin-left:6px;margin-top:4px;width: 30px; height: 18px; overflow: auto; padding: 4px; border: solid 2px #000000; background-color: #393c4d;">
{if $[post.created_by.custom_field.name] == "First Age"}$[post.created_by.custom_field.value]{/if}
</div></td>
<td><div style="margin-left:-31px;margin-top:4px;width: 102px; height: 18px; overflow: auto; padding: 4px; border: solid 2px #000000; background-color: #393c4d;">
{if $[post.created_by.custom_field.name] == "First Profession"}$[post.created_by.custom_field.value]{/if}
{/if}</div>{/foreach}</td>