Only show when value is yes
This example uses a C field with 6 subfields.
If the subfield value = yes then show the name.
Otherwise do nothing.
In the example below, the title is shown in any case.
<table class="table">
<thead>
</thead>
<tbody>
<tr>
<td>Textile</td>
<td>
@if(@Model.C359.C359_0.ToString() == "yes") <p>- Fine textured</p>
@if(@Model.C359.C359_1.ToString() == "yes") <p>- Pitted</p>
@if(@Model.C359.C359_2.ToString() == "yes") <p>- Tuberculate</p>
@if(@Model.C359.C359_3.ToString() == "yes") <p>- Spinose</p>
@if(@Model.C359.C359_4.ToString() == "yes") <p>- Rugose</p>
@if(@Model.C359.C359_5.ToString() == "yes") <p>- Recticulate</p>
</td>
</tr>
</tbody>
</table>
To show a fixed text when the value is not yes, then use the following code instead:
@if(@Model.C359.C359_1.ToString() == "yes") <p>- Pitted</p>
else {
<p>NOT PITTED</p>
}
The actual field values for all subfields of record BIO 1355 are:
The result looks like:
* Only the subfields with Yes as a value are displayed