Jump to content

Pages - Testing if database custom field is empty


-FP
 Share

Recommended Posts

In 3.x IP.Content, this would work: <if test="!$record['custom_field_id']">

In 4.x I see some stuff like "{{if $record->customFieldsForDisplay" or "$record->customFieldDisplayByKey", but I can't figure out how to test if there's anything in the field.

Any ideas?

Link to comment
Share on other sites

Cool, thanks. For some reason it didn't work using 'display', but I changed it to 'raw' and it worked. (My articles have a custom field to store a topic ID, and I show a link to the topic only if there's an ID stored in the field)

Edited by -FP
Link to comment
Share on other sites

Sorry for my ignorance. I am trying to understand this language but can not find a doc. Any reference I can read to understand this ?

I was looking for that earlier before starting this topic but I didn't find anything, well there's this http://community.invisionpower.com/4docs/, but it doesn't have anything about pages templates coding, hopefully they will add more information there.

Edited by -FP
Link to comment
Share on other sites

Oh yep I saw that, but honestly... well I'm not a programmer and I do most of my stuff searching around, reverse-engineering existing code, trying, copying and pasting, getting errors, trying again, getting more errors, until something works...

What I mean is that I would never get to the code I needed with this "{if $foo}}" or "{$foo|raw}" as the examples. I meant to say that I hope they add more "real-life" examples rather than just the logic behind it.

Edited by -FP
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...