We launched new forums in March 2019—
join us there
.
In a hurry for help with your website?
Get Help Now!
Back to MODX.com
Forums
Docs
Revo Issues
Blog
My Forums
Products
Revo Discussions & Support
Revolution 2.1
Search
[SOLVED] How to detect and not display blank fields
158 Posts
signcarver
Reply #1,
12 years, 2 months ago
Please forgive the basic / general nature of the question...
I have a "table" of TV variables like this:
<div>[[*data_1]]</div> ... ... <div>[[*data_N]]</div>
Can i write some code to detect if the field is blank and ignore that <div> so it doesn't take up space in the output?
Thank you very much!
Steve
[ed. note: signcarver last edited this post 12 years, 2 months ago.]
MODX Staff
10,725 Posts
opengeek
Reply #2,
12 years, 2 months ago
You can use the notempty Output Filter:
[[*data_N:notempty=`<div>[[*data_N]]</div>`]]
Jason Coward
Chief Architect @ MODX
http://www.jasoncoward.com
|
http://twitter.com/drumshaman
|
https://github.com/opengeek
158 Posts
signcarver
Reply #3,
12 years, 2 months ago
Thank you opengeek!!! That worked perfectly.
[ed. note: signcarver last edited this post 12 years, 2 months ago.]