Questions tagged [defined]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
121 views

Is defined conditional passing, yet causes a “do not have a method or closure named” error

Why is it that in the below, referencing stRow.caption causes an error despite being wrapped in an "if defined" check? The error is: Craft\SuperTable_BlockModel and its behaviors do not have a ...
1
vote
0answers
23 views

Twig “Is defined” throwing error on matrix row EntryModel property [duplicate]

When checking if a matrix block property is defined, I'm getting an error: Craft\EntryModel and its behaviors do not have a method or closure named "contentSource". The line that is throwing this ...
1
vote
1answer
2k views

Best way to deal with Impossible to access an attribute (“isEditable”) on a NULL variable (“”)

I've had this issue a few times & wanted to know if there is maybe a better way to deal with the following issue: Say I have this if on a page: {% if entry.isEditable %} <a href="{{ entry....
12
votes
2answers
8k views

What's the difference between “is defined” and “is not null”?

{% if var is defined %} and {% if var is not null %} Is there a difference in usage of them?