Parsing antlers string from one collection with data from another? #8492
-
Ok, so this may be the completely wrong way to go about / think of things but I'm basically trying to allow a user to manage antlers templates between two separate collections. One collection has a bard field with sets, the other just has "markup". Say I have two collections:
An example set from the
...and an
Is it possible to parse the {{?
use Statamic\Facades\Entry;
$view = Entry::query()
->where('collection', 'views')
->where('slug', Str::of($type)->slug('-'))
->first();
$markup = $view->get('markup')['code'];
?}}
{{ markup }} As in, Thank you for any suggestions! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You should be able to do that using the antlers facade. Statamic\Facades\Antlers::parse($markup, $data); |
Beta Was this translation helpful? Give feedback.
An Antlers-only way might look something like this (with the main addition being the
antlers
modifier):