From b96c71952736fc851e6696b68f40a16f1bce98a9 Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Mon, 21 Oct 2024 13:53:12 -0400 Subject: [PATCH] Document `$parent` and `$root`. --- content/collections/docs/conditional-fields.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/content/collections/docs/conditional-fields.md b/content/collections/docs/conditional-fields.md index cab202bdb..df5ac3cca 100644 --- a/content/collections/docs/conditional-fields.md +++ b/content/collections/docs/conditional-fields.md @@ -207,11 +207,18 @@ if: ## Field Context -By default, conditions are performed against values in the current level of `fields` in your blueprint. If you need access to values outside of this context (eg. if you are in a replicator, trying to compare against fields outside of the replicator), you can access root VueX store values by prepending your field with `root`: +By default, conditions are performed against values in the current level of `fields` in your blueprint. If you need access to values outside of this context (eg. if you are in a replicator, trying to compare against fields outside of the replicator), you can access parent field values by prepending your field with `$parent`: ```yaml if: - root.favorite_foods: includes bacon + $parent.favorite_foods: includes bacon +``` + +You can also access values at the top-level of your blueprint with `$root`: + +```yaml +if: + $root.favorite_foods: includes bacon ``` ## Custom Logic