Skip to content

Test for No Results #61

@jonlongnecker

Description

@jonlongnecker

I'm attempting to wrap an if statement around my maps code so that a blank map doesn't show up when there are no locations plotted. With 'blogLocations' being my custom field handle, I've tried these with no luck:

{% if entry.blogLocations is not null %}
{% if not entry.blogLocations|length %}
{% if not entry.blogLocations.total() %}
{% if entry.blogLocations is empty %}
{% if entry.blogLocations %}

What is the syntax for checking my field for no results??

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions