MODX Community

Truly bizarre problem with IF snippet and TVs in EVO

I have completely given up on what might be the cause of this very bizarre problem I’m having with IF. I’m using Evolution–which I know is no longer an official ModX product–but I’m hoping someone here will have some idea of what the heck might be going on.

Basically, I have a template that relies on IF to determine whether certain TV fields are empty or notempty, and then displays the content accordingly (if the TV field for this resource is NOTEMPTY, it displays the content; otherwise it displays nothing). VERY SIMPLE LOGIC.

It took me a bit of trial and error to get it to work at all because IF for EVO is not well documented. It works, but only in about half of the affected resources! There are four pages where the relevant fields are NOTEMPTY–which means the content in those fields should be displayed–but it isn’t. In the other pages that also have content in those fields, it displays just fine.

I looked in PHPMySQL to verify that the data is there, it is tied to the correct TV, and tied to the correct resource, but it is not displaying for these four resources.

  • I have cleared my cache in EVO (including deleting it and rebuilding it)
  • I have cleared my cache in my browser
  • I have deleted and rebuilt the TV from scratch (new ID, etc.)
  • I have tested whether the CMS will display the TV at all in the page (by placing it in the template without the IF logic) and it DOES, so I’m guessing it’s the snippet that’s the problem
  • I even changed it so that the snippet displayed a chunk that contained the TV, and no dice

I get no errors in any logs that suggest something is amiss, so I’m reaching out for help on the off-chance someone might know what’s up.

Here is my original IF logic statement:

[!If? &is=[*inTheAuthorsWords*]::not_empty &then=<h4>In the Author's Words</h4><div class="authorsWords">[*inTheAuthorsWords*]</div> &else=`` ]]

Here is what I changed it to (still only words for half the resources):

[!If? &is=[*inTheAuthorsWords*]::not_empty &then={{authorsWords}} &else=`` ]]

I’ll note also that this is one of four such statements in the template, and the others all work just fine in all affected resources.

If anyone has some suggestions for how I could troubleshoot this further, please let me know.

Thanks!
Michael

NOTE: When I saved this, I saw that the system strips out the quote tags in the snippet. This ARE in there in my code.