Display specific entry of repeatable field
-
I am trying to display the first value of a field in a PHP page template, but did not succeed. My code is as follows:
<?php
$compositions = pods('composition');
echo $compositions->display('cb-instrument', true);
?>cb-instrument is a repeatable text field. I set the $single parameter of the display() function to “true” following the function documentation, but obviously misunderstood the purose. I expected this statement to output the first entry of the field, but it still displays ALL entries.
How can I output the first, second, nth… entry of a repeatable field? And how can I maybe detect, if a repeatable field has several entries?
Thank you very much
Pascal
The topic ‘Display specific entry of repeatable field’ is closed to new replies.