0

I am trying to apply custom field override to my article and some of the fields I am trying to access are inside repeatable and non-repeatable subforms. Please how do I access and display subform repeatable fields?

1
  • Welcome to JSE. Please take our tour. Commented Nov 30, 2021 at 22:27

1 Answer 1

3

This helped me to solve my problem...

<?php $fieldX = json_decode($this->item->jcfields[X]->rawvalue, true); ?>

where X is the Id of the subform native field A, B, C is the respective Id of the custom fields inside of the subform.

NB: this solution only works for repeatable subforms. For subforms that are not repeatable, there is no need to loop through the associative array.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.