We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21475
    • 80 Posts
    Well, normally, you don’t have to copy anything in the head of your template, this is done by the snippet.
    Change the path in the snippet code if they are not correct:

    $src = "assets/snippets/yshout/js/jquery.js";
    $modx->regClientScript($src);
    $src2 = "assets/snippets/yshout/js/yshout.js";
    $modx->regClientScript($src2);
    $css = "assets/snippets/yshout/css/yshout.css";
    $modx->regClientCSS($css);
    $src3 = "<script type='text/javascript'>
    			$(document).ready(function(){
    				new YShout({
    					yPath: 'assets/snippets/yshout/'
    				});
    			});
    </script>";
    $modx->regClientScript($src3);


    And remove calls in the head, which aren’t necessary.
    You have placed a div id=yshout, are you sure it is displayed in your sources?
    If you see the div id=yshout, if you see the calls above in the head of your template (jquery.js, yshout.js, yshout.css, and the third call), then everything should work. Can you also provide a link to your test page?
      • 13928
      • 28 Posts
      I’m trying ...

      So, from beginning :

      1) I downloaded Yshout
      2) I copied yshout folder into my webserver in assets/snippets/
      3) I create new snippet called Chat and copied the code below:
      <?php
      $src = "assets/snippets/yshout/js/jquery.js";
      $modx->regClientScript($src);
      $src2 = "assets/snippets/yshout/js/yshout.js";
      $modx->regClientScript($src2);
      $css = "assets/snippets/yshout/css/yshout.css";
      $modx->regClientCSS($css);
      $src3 = "<script type=’text/javascript’>
      $(document).ready(function(){
      new YShout({
      yPath: ’assets/snippets/yshout/’
      });
      });
      </script>";
      $modx->regClientScript($src3);
      ?>

      4) I clicked edit on my CONTACT page in the tree on my left side, and insert in Resource Content :
      [!Chat!]
      <div id="yshout"></div>



      I erase what you told me, i checked in the source of my CONTACT page if it appears and it has.
      if I change src of code in my snippet to whole URL it still doesn’t work .

      http://ogledalo.si/prodaja/assets/snippets/yshout/.........



      my web page is www.ogledalo.si/prodaja

        • 21475
        • 80 Posts
        if you look at your source, you’ll see that js aren’t registered.
        Witch MODx version do you use?
        Try to change regClientScript with regClientStartupScript
        The CSS is registered, but is not found. yshout css might have change of location, change with the provided path (example/css...).

        Try to replace the snippet code with this :
        $src = "assets/snippets/yshout/js/jquery.js";
        $modx->regClientStartupScript($src);
        $src2 = "assets/snippets/yshout/js/yshout.js";
        $modx->regClientStartupScript($src2);
        $css = "assets/snippets/yshout/example/css/light.yshout.css";
        $modx->regClientCSS($css);
        $src3 = "<script type='text/javascript'>
        			$(document).ready(function(){
        				new YShout({
        					yPath: 'assets/snippets/yshout/'
        				});
        			});
        </script>";
        $modx->regClientStartupScript($src3);
        


        If it still doesn’t work, try to change the path included in the snippet, as Doze said (begin with [(site_url)] ).

        Finally, if it still doesn’t work, you might have another problem because there is already 2 js librairies included in your website (prototype + scripaculos, mootools), and yshout use jquery.
        Hope yshout use non conflict mode ($jQuery() instead of $()). You might have to mail the developper of yshout to check that.

        Hope this help.
          • 13928
          • 28 Posts
          I use modx 1.0.0.
            • 13928
            • 28 Posts
            unfortunatelly i’m cursed or what : )

            it doesn’t work


            I don’t know how to make js in non conflict mode.

            but thanks for helping me folks


              • 21475
              • 80 Posts
              It works on your contact page, no?
                • 13928
                • 28 Posts
                no, it doesn’t show anything....but yes, it should

                I ll write tutorial if we manage to do this : ) I SWEAR laugh
                  • 21475
                  • 80 Posts
                  js are now registered.
                  But the path is wrong.
                  Delete [(site_url)] from the path, it should work (you should have what i’ve wrote above).
                    • 21475
                    • 80 Posts
                    Also be carefull you have 2 divs with id=yshout.
                      • 13928
                      • 28 Posts
                      I copied your code in snippet ( no [(site_url)] in a path )

                      and delete one id=yshout.
                      now i have only one in "Kontakt" page

                      but doesn’t work huh