Feature request: support "ignore missing" behavior for live components #3298
Replies: 2 comments
-
|
Not something I’m planning right now, but I’d be happy to support and help if someone wants to push it forward. What’s the scenario here? How often does this run during the rendering of the main template? I’m asking because the advice is not the same depending on whether it’s a LiveButton rendered on every card in a 2,000 item grid... or a small static block in the footer of the legal notice page :) |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the quick reply. The behavior I'm looking for is exactly like Twig's {% include '...' ignore missing %} Basically, if the component does not exist, it should simply not render anything (fail silently) instead of throwing an error. Since it is a 'static block' scenario, performance shouldn't be an issue. If you can point me in the right direction, I'd be happy to take a look! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Symfony UX team,
I'm using Symfony UX Live Components and I have a question/feature request.
When including Twig templates, we can use include or embed with the "ignore missing" option. This is very convenient when a template might not exist, as it prevents errors.
I was wondering if there is a similar way to use Live Components and ignore the component if it does not exist, or gracefully fall back, like "ignore missing". Currently, if I try to render a component that is missing or cannot be instantiated, it throws an exception.
Is there a recommended approach or a planned feature to support this behavior in Live Components?
Thank you.
Luca
Beta Was this translation helpful? Give feedback.
All reactions