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.
    – mickmackusa
    Nov 30 '21 at 22:27
2

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, privacy policy and cookie policy

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