Empty Fields Returning True
  • I have created two custom article fields to insert extra content within the article. These extras should only appear if they contain content.

    Before printing the extra content, I test using if $campsite->article->side_note_text. Even if the "side_note_text" field is empty, the block is displaying. (It is styled with a border. That is how I know it is displaying.)
  • 1 Comment sorted by
  • I got around the problem by using if $campsite->article->side_note_text <> ""; however, it should return false automatically if no text exists.