I would like to use data-sly-resource
to include a resource, but only if it exists, e.g.
<div class="pull-right" data-sly-resource="/content/blog/stats"></div>
If the resource does not exist the script execution fails with the following error message: Cannot find servlet to handle resource /content/blog/stats . From the Request Progress listing I can see that it's a SyntheticResource
:
TIMER_START{resolveServlet(SyntheticResource, type=null, path=/content/blog/stats)}
How can I include the resource conditionally, only if it exists?