We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16429
    • 254 Posts
    I’ve created a check box list with this input values:
    Vino italiano=={{vinoit}}||Vino estero=={{vinoes}}||Liquori e distillati=={{dist}}||Alimentari=={{alim}}||Delicatessen=={{delic}}||Attrezzature=={{attr}}
    

    "Vino italiano=={{vinoit}}" is configured as default value.
    In my mind I figured that the result will be:

    • "Vino italiano" check box checked by default in the edited document;
    • Content of {{vinoit}} outputted on the page (because of the default checked box);
    • Nothing on the page if I uncheck all the check boxes.

    I was wrong: it outputs "Vino italiano==contents of chunk" on the page, the "Vino italiano" check box is not checked by default (if I check it the page output is the content of chunk, so it’s right) and everytime I uncheck all the check boxes it starts outputting "Vino italiano==contents of chunk" again.

    What is wrong, this beaviour or my expectations?

    Everything is fine if I use "Value" instead of "Name==value" in input value. Basically I can’t declare by default a value from those I’ve declared like "Name==value".

    MODx version is 0.9.2.1

    PS: mmm... I think I’ve broken around one hundred grammatical rules of English. A record.
    If you need I’ll explain further.

      kudo
      www.kudolink.com - webdesign (surprised?)

      [img]http://www.kudolink.com/kudolinkcom.png[/img] [sup]proudly uses[/sup] [img]http://www.kudolink.com/modx.png[/img]
    • The parser will translate any chunks it finds into their represented values.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 16429
        • 254 Posts
        The problem is not the chunk... I know, I’ve done better if I chopped that thing out of the example...

        Leave chunks aside, it works perfectly, this is not the problem.

        The problem is that I can’t check the first check box by default, ’cause the default area doesn’t understand "Name==Value" as "check the Name box and use Value as output".
          kudo
          www.kudolink.com - webdesign (surprised?)

          [img]http://www.kudolink.com/kudolinkcom.png[/img] [sup]proudly uses[/sup] [img]http://www.kudolink.com/modx.png[/img]
          • 7923
          • 4,213 Posts
          What happens if you just put the value of the checkbox you want to be checked by default to the default value field? Like {{vinoit}} for example.


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 16429
            • 254 Posts
            No check box is checked but the TV outputs {{vinoit}} as I would.

            Attention: this may seem a good behaviour (the {{vinoit}} chunk is visible by default, in effects) but it scrambles up my Ditto filters in another page, because the TV is not recognized as "{{vinoit}}" (that checkbox is unchecked, after all).

            Needing that type of filter, I rethinked the management of that multi-checkbox TV in an array of different TVs with one check box.

            But I’m still curious on how to accomplish the right kind of behaviour.
              kudo
              www.kudolink.com - webdesign (surprised?)

              [img]http://www.kudolink.com/kudolinkcom.png[/img] [sup]proudly uses[/sup] [img]http://www.kudolink.com/modx.png[/img]