modxbot / migrate

A testground for migrating issues and other such fun
0 stars 0 forks source link

Equals Sign in Parameters Breaks Entire Chunk (nested only) #5296

Open yoleg opened 13 years ago

yoleg commented 13 years ago

yoleg created Redmine issue ID 5296

This problem is very particular to a particular nesting structure:

  1. I use a chunk called [[[[$box]]]] to form a stylistic HTML wrapper around content. For example, [[[[$box? &class=blue &content=Hello there]]]] results in a fancy box with a class and content as specified - this is very important to my design (so I don't have to use three different chunks for $box_start,$box_middle, and $box_end). The content of $box is:

    [[+content]]
  2. I put another chunk (a widget) inside of the box:
    [[$box? &content=[[$widget]]]]
  3. Finally, if (in the content of $widget), I place any snippet with a parameter containing an equals sign, it breaks the box. In other words, set the content of $widget to something like below to break the box:

    [[!Wayfinder? &startId=`0` &test=`=`]]

On the other hand, changing it as follows results in a working box:

[[!Wayfinder? &startId=`0` &test=`something else`]]

Equals signs come up quite a bit in snippet parameters (especially in lists that require == for a separator), so this effectively prevents me from using my fancy HTML wrapper around certain output.

An interesting fact is that putting the content DIRECTLY into the box's content parameter does not cause the problem. In other words, the following code works just fine:

[[$box? &content=` 
[[!Wayfinder? &startId=`0` &test=`=`]]
`]]
opengeek commented 13 years ago

opengeek submitted:

Interesting; seems to be a problem with property parsing at first glance; I'll follow-up on this with some tests.

In the meantime, you might try just passing the name of the chunk and any property string to your chunk. As an example, I use this sidebox chunk throughout my site:


Calling it like so:

[[$sidebox?
    &title=`[[getValue? &class=`modResource` &field=`menutitle` &where=`{"id":[[UltimateParent]]}`]]`
    &element=`Wayfinder`
    &properties=`@SidebarMenu? &startId=`[[UltimateParent]]` &level=`1``
]]
[[$sidebox?
    &title=`Notable Quotable`
    &element=`!getResources`
    &properties=`@quotes-random? &limit=`1``
]]
[[$sidebox?
    &title=`Search`
    &element=`$search`
]]