We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7923
    • 4,213 Posts
    By looking at the code, it seems that you need 2 call, one in the <head></head> section with &display=`0` parameter in the snippet call (this makes it print the css link) and another call with &display=`1` (default is 1) for the selection thing..


      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
      • 21483
      • 32 Posts
      So I would add this to the header:

      [!CssSwitcher? &display=`0`!]

      Bad thing is, when I do that I get error message. If i write it inside an extra pairs of [ ], it doesn’t make any errors, but no changes (apparently) too.
        • 21483
        • 32 Posts
        Man, does this great snippet need some proper documentation or what? shocked
          • 7923
          • 4,213 Posts


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 21483
            • 32 Posts
            Thx again doze, but it seems I’m having serious problems with this snippet.

            I can call the snippet in the head and make it do stuff, or call it in the body and do stuff, but if I call it in both the head AND the body then i get this error message in firefox:

            Fatal error: Cannot redeclare getchunk() (previously declared in /mounted-storage/home43c/sub002/sc32329-SIRJ/kreativpotens.dk/modx/manager/includes/document.parser.class.inc.php(748) : eval()’d code:278) in /mounted-storage/home43c/sub002/sc32329-SIRJ/kreativpotens.dk/modx/manager/includes/document.parser.class.inc.php(748) : eval()’d code on line 313

            IE7 just shows a blank page. I get this error no matter what I put in the body snippet call.
              • 7923
              • 4,213 Posts
              wrap the getChunk function in the code inside if(!function_exists(getChunk)) { } block. Eg. add if(!function_exists(getChunk)) { to line 270 and } to line 313. Then the same for the freeCommonVars() function below, but with if(!function_exists(freeCommonVars)) { } block obviously.


                "He can have a lollipop any time he wants to. That's what it means to be a programmer."