We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16732
    • 592 Posts
    This is an auto-generated support/comment thread for FootNote.

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    Make footnotes
      • 12725
      • 11 Posts
      Maybe I’m doing something wrong, but I installed this plugin and it’s not behaving as it ought to. The tags that are supposed to enclose the footnote:

      e.g., {-this is an example of a footnote-}

      are formatted correctly (as far as I can tell), but when the page is loaded the tags are visible on the screen and no footnotes are created. I made sure the ’OnLoadWebDocument’ event was checked, as per the instructions. So far, no luck. Any ideas?
        • 12725
        • 11 Posts
        The PIP footnote plugin seems to work fine with short footnotes, but once you get past a certain length (say, 15-20 words), the plugin stops working, leaving the footnote in the body of the text (rather than at the bottom of the page) and the delimiter visible to all Does anyone have any ideas/tips/pointers on how to overcome this limitation of the plugin? I looked at the code to try to figure out why it stops working after a certain length, but its beyond my poor abilities. Any help in this matter would be greatly appreciated.
          • 6726
          • 7,075 Posts
          Do you run the latest version (1.1) ?

          If it still doesn’t work, one thing would be to notify laurentc of this (send him a Private Message), he’ll sure be able to answer this...
            .: COO - Commerce Guys - Community Driven Innovation :.


            MODx est l'outil id
            • 12725
            • 11 Posts
            Thanks for the response, davidm.

            Yes, I’m using the most recent version. I’ll try to PM laurentc to see if he has any ideas. Thanks for the tip!
              • 4095
              • 372 Posts
              Hoping someone can help me, I am trying to add a CLASS to the code so I can style the footnote on the page. I figured out it has to go in this section

              $npp .= "<br/><br/>--- Notes ---";
                                      for($i=0;$i<count($tbl_npp1);$i++) {
                                          $numbNote = $i+1;
                                          $npp .= '<br/> [<a href="'. $page.'#nh'.$numbNote.'" name="nb'.$numbNote.'">'.($i+1).'</a>] '.substr(substr($tbl_npp1[$i],2),0,strlen($tbl_npp1[$i])-4);
              
                                          $modx->documentObject['footnotes'][$i]=substr(substr($tbl_npp1[$i],2),0,strlen($tbl_npp1[$i])-4);
                                      }
              
                                     $o .=  $npp;
              
                                }
                              else{
                                 return;


              However when I replaced a
              with <p class="footnotes"> it displays the footnote in the body not as a footnote, also hadn’t managed to find where to put the closing tag yet.

              $npp .= "<p class="footnotes"><br/>--- Notes ---";
                                      for($i=0;$i<count($tbl_npp1);$i++) {
                                          $numbNote = $i+1;
                                          $npp .= '<br/> [<a href="'. $page.'#nh'.$numbNote.'" name="nb'.$numbNote.'">'.($i+1).'</a>] '.substr(substr($tbl_npp1[$i],2),0,strlen($tbl_npp1[$i])-4);
              
                                          $modx->documentObject['footnotes'][$i]=substr(substr($tbl_npp1[$i],2),0,strlen($tbl_npp1[$i])-4);
                                      }
              
                                     $o .=  $npp;
              
                                }
                              else{
                                 return;

                [img]http://www.emanz.ac.nz/assets/images/logo/emanz-icon_16x16.gif[/img] Emergency Management Academy of New Zealand [br] http://www.emanz.ac.nz[br][br]MODx Sandbox Login: sandbox Password: castle [br]
                Admin Sandbox Login: sandbox Password: castle
                • 16732
                • 592 Posts
                Hi Briggsy,

                There is an undefined conflict with the $modx->documentObject[’footnotes’] but the code below is working now :


                $e = &$modx->Event;
                switch ($e->name) {
                case "OnLoadWebDocument":
                $o = &$modx->documentObject[’content’]; // Référence de la sortie
                // récupération de tous les Npp {-NPP-}
                if(preg_match_all( ’~\{-(.*?)\-\}~’ , $o, $tbl_npp)){

                if($modx->config[’friendly_urls’] == 1){$page = $modx->documentObject[’alias’];}else {$page= ’index.php?id=’.$modx->documentObject[’id’];}

                $tbl_npp1 = array_unique($tbl_npp[0]);
                for($i=0;$i<count($tbl_npp1);$i++) {
                $numbNote = $i+1;
                $o = str_replace($tbl_npp1[$i],’<sup><a href="’. $page.’#nb’.$numbNote.’" name="nh’.$numbNote.’">’.($i+1).’</a></sup>’,$o);
                }

                $npp .= ’<p class="footnotes">

                --- Notes ---’;
                for($i=0;$i<count($tbl_npp1);$i++) {
                $numbNote = $i+1;
                $npp .= ’
                [<a href="’. $page.’#nh’.$numbNote.’" name="nb’.$numbNote.’">’.($i+1).’</a>] ’.substr(substr($tbl_npp1[$i],2),0,strlen($tbl_npp1[$i])-4);

                //$modx->documentObject[’footnotes’][$i]=substr(substr($tbl_npp1[$i],2),0,strlen($tbl_npp1[$i])-4);
                }
                $npp .= ’</p>’;

                $o .= $npp;

                }
                else{
                return;
                }

                break;
                default :
                return;
                break;

                }

                  • 4095
                  • 372 Posts
                  Awsome, thanks for the quick response. It works a treat wink
                    [img]http://www.emanz.ac.nz/assets/images/logo/emanz-icon_16x16.gif[/img] Emergency Management Academy of New Zealand [br] http://www.emanz.ac.nz[br][br]MODx Sandbox Login: sandbox Password: castle [br]
                    Admin Sandbox Login: sandbox Password: castle
                    • 21642
                    • 23 Posts
                    Hello. Very nice and usefull plugin. Thank you for sharing the idea.
                    I have a question: I use the Pagination plugin. The footnote work only if the note is on the first page. Otherwise (let’s say page 2) will serve you first page ... where is no footnote.

                    Have an idea about some modification to this situation?
                      • 16732
                      • 592 Posts
                      To solve your problem I have to see the Pagination plugin... I’m very busy these days, but I will try to look at it this week-end and see what I can do.