O field in razor (Ontology)
The Ontology field in the razor is treated like a link field, therefore @foreach need to be used.
-
for instructions on how to show the linked data (plus extra fields in the target table) in a table format, see Show linked records, plus extra fields, in a table format.
-
for instructions on how to make the link value clickable, see Link to see more details about target record.
<tr>
<td>@Model.O472.Label</td>
<td>
@foreach(var ontology in @Model.O472) {
<span><p> @ontology.Name</p</span>
}
</td>
</tr>
Extra explanation on the code:
-
@foreach is needed to make sure that all levels are displayed.
-
ontology own chosen name for this variable.
-
@ontology.Name the record name of the higher level.
The code placed in a table:
<table class="table">
<thead>
</thead>
<tbody>
<tr>
<td>@Model.O472.Label</td>
<td>
@foreach(var ontology in @Model.O472) {
<span><p> @ontology.Name</p</span>
}
</td>
</tr>
</tbody>
</table>