Skip to content
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

Test for No Results #61

Open
jonlongnecker opened this issue Jun 8, 2016 · 1 comment
Open

Test for No Results #61

jonlongnecker opened this issue Jun 8, 2016 · 1 comment

Comments

@jonlongnecker
Copy link

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??

@jonlongnecker
Copy link
Author

Playing around a bit more I was able to get this to work by calling on the markers function:

{% if entry.blogLocations.getMarkers is not empty %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant