Hi.
I noticed that when i create a resource based on a template with a MIGX TV, that the contentvalue of the TV is initialy []. (in prefix_site_tmplvar_contentvalues)
This is pretty annoying since i'm also using the :notempty filter.
Only when i enter a value in the TV and then remove that value is the contentvalue empty.
Can the initial contentvalue for a MIGX TV be really empty please for a newly created resource?
RDG
An empty MIGX - TV can be either really empty like
''
or an empty json-array like
[]
To get sure the test for an empty output is getting the correct result, you can use the &toPlaceholder - property like:
[[getImageList?
&tvname=`yourTV`
&tpl=`yourTpl`
&toPlaceholder=`migxoutput`
]]
[[+migxoutput:isnot=``:then=`[[+migxoutput]]`:else=``]]
But why is the initial value an '[]' instead of ''?
seems so unnessecary
and it took me a while before i figured out what was going on because it is so illogical.
RDG
its very logical, MIGX does output an array as json-string and an empty array is: []
It can be empty initially, when no value was added at all, but as soon as you empty an array the result is []
May be, I should work on that, but this can take a while.
I, for myself, I'm ok with that so far.