-
-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
partial:exists tag fails in nested partials #4993
Comments
Weird. Can you provide the rest of the template? |
Sure, kind of, I've been trying to work around it but I'm still getting the error when I do this:
What I'm trying to do is build a view that handles generic forms created by a user in the CMS. However there are a couple of specific forms that are going to need some specific template handling, so I wanted to make it so I could just create the template based on the form handle and drop it in. Instead I'm having to do something like:
But as you can see, new specific forms would need both a new template and be added to this if/else statement in this template. |
Also possibly relevant |
Digging into the Statamic code a bit here.
This is why it's trying to render a view called 'exists' - because Digging further this is because this is called from within a partial, it's a nested partial. eg.
Now the Partial tag for the exists check gets the following parameters:
Instead of the expected
|
Nice detective work! |
Bug description
Using a conditional for whether the partial exists as per the documentation here:
https://statamic.dev/tags/partial-exists
I get this exception, it appears it's not treating it as it's own tag, but attempting to use the shorthand {partial:path/to/view} and the view 'exists' doesn't exist. I'm using it exactly as documented though, so I can't see how it's user error (though if it is please do let me know how/where).
How to reproduce
This is the relevant part of my template
Logs
Versions
Statamic 3.2.28 Pro
Laravel 8.77.1
PHP 7.4.26
arckinteractive/statamic-bard-custom-class dev-master
arckinteractive/statamic-bard-font-size 1.0.0
arckinteractive/statamic-bard-font-weight 1.0.1
doublethreedigital/duplicator 2.0.1
goldnead/statamic-collapse-fieldtype 1.0.4
optimoapps/statamic-bard-text-align 1.0.2
xndbogdan/statamic-bard-text-color 2.2
Installation
Existing Laravel app
Additional details
No response
The text was updated successfully, but these errors were encountered: