Open exside opened 12 years ago
I try to collect more information about this issue, so I'll post my setup here:
[
{"caption":"Row", "fields":[
{"field":"desc", "caption":"Description what's inside, bc inner grid cannot be rendered here", "inputTV":"migx.gridItemDesc"},
{"field":"cols", "caption":"Columns", "inputTV":"migx.grid.inner.cols"},
{"field":"colnum", "caption":"Number of Columns", "inputTV":"migx.gridItemCols"},
{"field":"hide", "caption":"Hide", "inputTV":"migx.gridItemHide"}
]}
]
[
{"caption":"Columns", "fields":[
{"field":"title", "caption":"Title", "inputTV":"migx.gridItemTitle"},
{"field":"link", "caption":"Column link", "inputTV":"migx.gridItemLink"},
{"field":"text", "caption":"Column Text", "inputTV":"migx.gridItemText"},
{"field":"code", "caption":"Special Code, for example you can call here getResources", "inputTV":"migx.gridItemCode"},
{"field":"hide", "caption":"Hide column", "inputTV":"migx.gridItemHide"}
]},
{"caption":"Image", "fields":[
{"field":"img", "caption":"Image", "inputTV":"migx.gridItemImage"},
{"field":"imglink", "caption":"Imagelink", "inputTV":"migx.gridItemImageLink"}
]}
]
This is the MIGX setup in the backend... in the frontend (to output what was entered in the grids) I just use a double getImageList call like shown in the following:
This calls the outer MIGX TV and generates the rows, basically it just sets the number of columns inside that row or hides the entire row, the rest is handeled by the inner getImageList snippet call which is embedded in the &tpl param of the outer call that is located in the main template and not wrapped inside some conditionals or anything special.
[[!getImageList? &tvname=`migx.grid.rows` &tpl=`migx.gridRowTpl`]]
and the corresponding chunk with the name migx.gridRowTpl, to pass in the inner migx grid to the second/inner getImageList snippet call I had to use the &value
param because basically the inner grid is just a JSON object which get's it's own placeholder in the outer template, so this replaces the param &tvname
...
[[+hide:is=`yes`:then=``:else=`<div class="row [[+colnum]]">
[[!getImageList? &value=`[[+cols]]` &tpl=`migx.gridColTpl`]]
</div>`]]
The &tpl
chunk for the inner getImageList snippet call is build with some niftyer stuff and looks as follows (I stripped out some unimportant stuff to make it shorter). What it does is first check if the column should be hidden (like with the rows...) then if the links are emtpy (that's kind of unintuitive, but when the normal link and the image link are the same then they are possibly empty bc editors shouldn't fill out both fields =D) the first chunk migx.gridColContent is called with params which pass the content of the inner migx grid to the chunk itself, otherwise the second chunk migx.gridColContentLinked is called in the same manner, but including the link information which wasn't needed for the first chunk. The strange :replace='$$==?'
is my temporary workaround until this issue is solved...I told the editors to just write a double dollar sign $$ when they need a questionmark somewhere...it works, but it's a pain in the ass...
[[+hide:is=`yes`:then=``:else=`<section class="col">
[[+link:is=`[[+imglink]]`:then=`
[[$migx.gridColContent?
&colnum=`[[+colnum]]`
&title=`[[+title:replace=`$$==?`]]`
&text=`[[+text:replace=`$$==?`]]`
&code=`[[+code:replace=`$$==?`]]`
&hide=`[[+hide]]`
&img=`[[+img]]`
]]`:else=`
[[$migx.gridColContentLinked?
&colnum=`[[+colnum]]`
&title=`[[+title:replace=`$$==?`]]`
&link=`[[+link:replace=`$$==?`]]`
&text=`[[+text:replace=`$$==?`]]`
&code=`[[+code:replace=`$$==?`]]`
&hide=`[[+hide]]`
&img=`[[+img]]`
&imglink=`[[+imglink:replace=`$$==?`]]`
]]`]]
</section>`]]
This issue shows it's head more or less everywhere where a question mark (?) can occur (as you can tell from the number of :replace modifiers), in titles like <h3>Do you want to buy?</h3>
or text like <p>What kind of questions should we ask?</p>
or code like [[!getResources? ¶ms='']]
or links with GET variables like http://www.someurl.tld/page.html?somevar=somevalue&anothervar=value
so it's completely not dependent on the type of the TV (these were normal text, textarea and richtext TVs).
Because the replacement of the $$ with an ? works I think that the problem lies somewhere in the outer MIGX TV respectively in the processing of the outer getImageList snippet call but there my knowledge stops understanding =)...another fact that maybe supports this thesis is that if ONE col has a question mark (?) inside, the WHOLE ROW doesn't display, not just that column...
In the last weeks I have gone a bit further with MIGX than ever before, meaning to put another MIGX grid inside a MIGX TV, so basically its MIGX in MIGX, which works fine most of the time and opens crazy flexibility, which is great.
Though I almost jumped out of the window searching for an issue I had which took me days to get behind, and then it was so "easy" but not really obvious (at least from my perspective =D)...to the point:
When I have a question-mark (?) somewhere in the inner MIGX-TV then there is no output by GetImageList, it doesn't matter what kind of TV it is, had it in richttext, normal Text, URLs doesn't matter...it will just output nothing but also throw no errors, the entry is there in the backend but just not displaying in the frontend, just like it wasn't there^^ (image how crazy you can get with something like this =D).
For example I had a list of links (edited via richttext tv with tinymce) in one field, the URL behind the Linktext had a ? inside, like http://www.url.tld/resource.php?param1=x&andsoon=1 and this was enough to cause this issue...
I gave up on this, bc I just didn't find out why it wasn't displayed. Then I had the same issue on a page with NO links, but a long text (an interview to be precise), I tried about everything with the text (even began writing it manually...) and blaming it to be corrupted or something...but no, the problem were all the question marks in the interview-questions...as soon as I removed them (which is not very good btw but I cannot solve it in another way right now, for the links I could via simple javascript and replacing ? manually by # then replacing them on the frontend with jquery...) it worked like a charm...
I really don't know why this is happening and if this has ever showed up in another setup, but it's at least a serious issue if not a blocker, so if you need more demonstration I can record a screencast or provide you access to the installation...