I use:
I would like to check if my placeholder is empty.
{
Here's a very compact solution.
Template filter:
@register.filter('placeholder_is_empty')
def placeholder_is_empty(request, slot):
page = request.current_page
placeholder = page.placeholders.get(slot=slot)
return placeholder.cmsplugin_set.exists()
Usage in template:
{% if request|placeholder_is_empty:'myplaceholder' %}
Here comes some content...
{% endif %}