ALSO
I end up with not using controller
or data filter
because I use a lot of ACF option page variables.
Data Filter
would not pass ACF option page variables to post type page(like normal POST). And Controller
, I feel it required too much lines that not simple as data filter
.
My solution is just use BLADE
php, and for each set of variable I put them to related parts or templates.
Example:
home-page.blade.php
@php
$var = get_field('var');
@endphp
** if you use repeater with get_sub_field
, you need to put the above lines inside of the @whille
loop.
<p>{{ $var }}</p>
or
<p>{!! $var !!}</p>
Sometime if your field content has html markup code, you may just do normal {{ the_field('var') }}
because this way would not output a blank format, like: TEST<sup>*</sup>
.
Hope that helps!