I’m creating some templates with some pages on my site and have some sets of data that are stored in metaobjects that I want to place on specific pages that are using this template.
This metaobject has a Type:ja_equipment_features_specs_01
I’ve created 2 instances within this metaobject:
This instance within the metaobject has a handle: kalmar-light-electric-forklift-trucks
I’ve referenced this metaobject in a metafield that I’m dynamically calling in a section block on one of my pages that are using this template.
So everything is mostly good and the items within the reference metaobject instance are populating a table that I’ve created.
This leads me to my sticking point/question: Most instances within my metaobject will have a different amount of data and I want to display in a tabular format.
How do I hide empty cells when there is no dynamically linked content form the metaobject instance?
Here is my section code:
{% for block in section.blocks %}
<table class="equipment-specs">
<thead>
<tr>
<th>{{ block.settings.feature-description-title }}</th>
<th>{{ block.settings.feature-value-title }}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ block.settings.feature-description-01 }}</td>
<td>{{ block.settings.feature-value-01 }}</td>
</tr>
<tr>
<td>{{ block.settings.feature-description-02 }}</td>
<td>{{ block.settings.feature-value-02 }}</td>
</tr>
<tr>
<td>{{ block.settings.feature-description-03 }}</td>
<td>{{ block.settings.feature-value-03 }}</td>
</tr>
<tr>
<td>{{ block.settings.feature-description-04 }}</td>
<td>{{ block.settings.feature-value-04 }}</td>
</tr>
<tr>
<td>{{ block.settings.feature-description-05 }}</td>
<td>{{ block.settings.feature-value-05 }}</td>
</tr>
<tr>
<td>{{ block.settings.feature-description-06 }}</td>
<td>{{ block.settings.feature-value-06 }}</td>
</tr>
<tr>
<td>{{ block.settings.feature-description-07 }}</td>
<td>{{ block.settings.feature-value-07 }}</td>
</tr>
<tr>
<td>{{ block.settings.feature-description-08 }}</td>
<td>{{ block.settings.feature-value-08 }}</td>
</tr>
<tr>
<td>{{ block.settings.feature-description-09 }}</td>
<td>{{ block.settings.feature-value-09 }}</td>
</tr>
<tr>
<td>{{ block.settings.feature-description-10 }}</td>
<td>{{ block.settings.feature-value-10 }}</td>
</tr>
<tr>
<td>{{ block.settings.feature-description-11 }}</td>
<td>{{ block.settings.feature-value-11 }}</td>
</tr>
<tr>
<td>{{ block.settings.feature-description-12 }}</td>
<td>{{ block.settings.feature-value-12 }}</td>
</tr>
<tr>
<td>{{ block.settings.feature-description-13 }}</td>
<td>{{ block.settings.feature-value-13 }}</td>
</tr>
<tr>
<td>{{ block.settings.feature-description-14 }}</td>
<td>{{ block.settings.feature-value-14 }}</td>
</tr>
<tr>
<td>{{block.settings.feature-description-15}}</td>
<td>{{block.settings.feature-value-15}}</td>
</tr>
</tbody>
</table>
{% endfor %}
I’ve come across this as a potential solution but I don’t think I was referencing the entry in the metaobject instance correctly:
<tr>
<td>{%if product.metafields.my_fields.season.value == blank %}
{%else%}{{product.metafields.my_fields.season.value}}
{%endif%}</td>
</tr>
Looking for some guidance on how I can come up with an efficient solution to hide these unpopulated fields as I’ll have many pages that will be using this template and will be utilizing different metaobjects for content.
Thanks in advance!




