We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7231
    • 4,205 Posts
    Place the WebLogin snippet in a MODx document and call that document into your modal.
      [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

      Something is happening here, but you don't know what it is.
      Do you, Mr. Jones? - [bob dylan]
      • 6638
      • 20 Posts
      First of all I have changed my thickbox.php in this line as the information for height a.s.o was not correct displayed !
      Now it works fine.

      $output = '<a href="'.$page.'?height='.$height.'&width='.$width.'&modal='.$modal.'" class="'.$embedtype.'" title="'.$title.'">'.$buttontxt.'</a>';


      OK I have created a new document [with doc ID 57] and without any css !

      Than I put the following call into my test document:

      [!ThickBox? &embedtype=`thickbox` &title=`Please Sign In` &page=`[~57~]` &height=`85` &width=`250` &modal=`true` &buttontxt=`Login`!]


      but all that I get is a empty box ! In Firebug I can see the following output:

      <div id="TB_overlay" class="TB_overlayBG"/>
      <div id="TB_window" style="margin-left: -140px; width: 280px; margin-top: -220px; display: block;">
      <div id="TB_ajaxContent" class="TB_modal" style="width: 250px; height: 395px;"/>
      </div>


      It seems that the document is not submitted to ThickBox !


        -------
        if you have no idea, just shut up
        • 7231
        • 4,205 Posts
        &page=`[~57~]`
        Dont think this will work. Set the id only and build the link in the snippet.
          [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

          Something is happening here, but you don&#39;t know what it is.
          Do you, Mr. Jones? - [bob dylan]
          • 6638
          • 20 Posts
          ok thats right, thanks for the hint. It´s working fine.

          No I have to decide if I have a page with ? or not. But I don´t know the a operateor like * or % for any sign !

          if ($page == '*?*'){ // filter out index.php page calls to get a correct page !
           $output = '<a href="'.$page.'&height='.$height.'&width='.$width.'&modal='.$modal.'" class="'.$em        bedtype.'" title="'.$title.'">'.$buttontxt.'</a>';
          } else {
           $output = '<a href="'.$page.'?height='.$height.'&width='.$width.'&modal='.$modal.'" class="'.$em        bedtype.'" title="'.$title.'">'.$buttontxt.'</a>';
           }
          
            -------
            if you have no idea, just shut up
            • 6638
            • 20 Posts
            oh man ... how stupid !

            I found my fault ! It was not a problem with the regular expressions ... it was what I tested !
            Here are my three calls:

            [!ThickBox? &embedtype=`thickbox` &title=`Please Sign In` &page=`assets/snippets/thickbox/ajaxLogin.html` &height=`85` &width=`250` &modal=`true` &buttontxt=`Login`!]
            
            [!ThickBox? &embedtype=`thickbox` &title=`Please Sign In` &page=`[~57~]` &height=`85` &width=`250` &modal=`false` &buttontxt=`Login`!]
            
            [!ThickBox? &embedtype=`thickbox` &title=`Please Sign In` &page=`index.php?id=57` &height=`85` &width=`250` &modal=`false` &buttontxt=`Login`!]


            the first is working fine, the second also now [if condition is: if (eregi("\[~[0-9][0-9]~\]", $page)) {] to get all calls with [~<page>~]

            I thought all the time that I have a call like index.php?id=57 ... and wondered why my if don´t work ! the [~57~] is resolved after the if condition !

            Also I found out that if I create a link with index.php?id=57 only index.php will be transmitted !
              -------
              if you have no idea, just shut up
              • 7231
              • 4,205 Posts
              I think that the ? interferes with the snippet parsing. Some snippets use a different syntax to get around this (see FeedX) where a substitue is used like |eq| instead of ? and then it is put back together in the snippet logic.
                [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                Something is happening here, but you don&#39;t know what it is.
                Do you, Mr. Jones? - [bob dylan]
                • 6638
                • 20 Posts
                Yes that was a great hint. As not only the ? also the = makes trouble ! Now I will use it in that way. If anybody wants to use it wit ? = & he has to use |xq|, |xe| and |xa| instead !

                $page = str_replace(array('|xq|','|xe|','|xa|'), array('?','=','&'), $page);
                if (eregi("\[~[0-9][0-9]~\]", $page) || eregi("\?", $page)) {
                 $output = '<a href="'.$page.'&height='.$height.'&width='.$width.'&modal='.$modal.'" class="'.$embedtype.'" title="'.$title.'">'.$buttontxt.'</a>';
                } else {
                 $output = '<a href="'.$page.'?height='.$height.'&width='.$width.'&modal='.$modal.'" class="'.$embedtype.'" title="'.$title.'">'.$buttontxt.'</a>';
                }


                but now I have seen that when I log on in my tb that I will landing on the called page. In that case with id=57 instead remaining on the page I called it!

                Maybe this is due to call a new page. As the original weblogin is just a snippet on an existing page !
                  -------
                  if you have no idea, just shut up
                  • 20349 ☆ A M B ☆
                  • 453 Posts
                  After reading all this, I only got lost smiley

                  I want to acheive the following:
                  - on my homepage have a link
                  - when pressed I wan’t to open a document (something like [~100~] )
                  - in the document with ID "100" there is a eForm (so user can make contact)

                  Can you help me out? smiley

                  (mootools and jquery are used on hompage with snippets like maxigallery and others...)
                    BASE - Web Design Studio
                    MODX Ambassador

                    Website
                    • 6638
                    • 20 Posts
                    Hello,

                    sorry I stopped this at the moment as I`m also not so good in programming.

                    My last problem was that in the main page the called page was loaded instead closing with thickbox "window".

                    I tried to do this with java onClick but found no solution.

                    Sorry
                      -------
                      if you have no idea, just shut up