We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32669
    • 20 Posts
    Absolutely brilliant, Thanks a great lot. Is there an easy way to include a scriptaculous scroll effect, the .js is already called..

    Wouter
      • 22797
      • 134 Posts
      I suppose that depends on what you want the script to do and what needs to be present in the html code for the script to work. The plugin is not set up with parameters for adding extra attributes (such as onclick) to the TOC links right now, so if that’s what you need, you would need to modify the source code. If you need something else, it may or may not be possible with the code as it is currently written.
        • 10470
        • 48 Posts
        great plugin, thanks grin

        one small improvement would to be able to set the ul id.

          • 2327
          • 214 Posts
          Hello,

          Thank you for this script. But for me, the differents tags are not interpeted by Modx.

          Exemple in a page content, Iput this HTML code :

          <!--#toc_plugin#_START_CONFIGURATION-->
          <!--#toc_plugin#_list_type=ul-->
          <!--#toc_plugin#_start_level=2-->
          <!--#toc_plugin#_end_level=3-->
          <!--#toc_plugin#_header=Page Contents-->
          <!--#toc_plugin#_header_tag=h2-->
          <!--#toc_plugin#_parent_tag=div-->
          <!--#toc_plugin#_parent_tag_id=toc-->
          <!--#toc_plugin#_END_CONFIGURATION-->

          <!--#toc_plugin#_TOC_OUTPUT-->

          <!--#toc_plugin#_START_TOC_INDEXING-->
          <h2>Here is a heading</h2>
          <p>Here is some text</p>
          <h2>Here is another heading</h2>
          <h3>Here is a subheading</h3>
          <h3>Here is another subheading</h3>
          <!--#toc_plugin#_END_TOC_INDEXING-->


          And in an other div on my page, i put :
          <!--#toc_plugin#_TOC_OUTPUT-->

          But absolutely nothing appear ! And the plugin is properly configured with OnWebPagePrerender.

          The tag are not interpreted and appear as comment in the source code.

          Help... tongue



            • 22797
            • 134 Posts
            It’s hard to know from your description what’s causing the problem, but it sounds like you’ve put the output marker twice on the same page ( <!--#toc_plugin#_TOC_OUTPUT--> ). If that’s the case, you could start by deleting one of them.

            There may also be a conflict with another plugin, but I haven’t experienced that myself.

            Other than that, nothing else comes to mind at the moment, but I’m sure there could be other factors.
              • 2327
              • 214 Posts
              Thak you very much, Paul !

              I test with a different configuration.

              Just a question :

              Can y put those tags anywhere ( for example in a template ?) and arround the [*#content*] of my page, for exemple like :

              <!--#toc_plugin#_START_TOC_INDEXING-->
              [*#content*]
              <!--#toc_plugin#_END_TOC_INDEXING-->

              And put the <!--#toc_plugin#_TOC_OUTPUT--> in a other div on my template, outer the content layer ?
                • 2327
                • 214 Posts
                Paul,

                I have tested your plugin in differents Modx install (all are 0.9.6). But nothing takes place.

                I deactivated all plugins using WebPagePrerenderer. But no issue !

                Here are the made operations :

                1) I copy and paste all the content of your Page_TOC_Generator_0.76.txt in a new plugin, named : Page TOC Generator. And i active (and only active this) the case : OnWebPagePrerender.

                2) I create a new document using the minimal template of Modx and put this html code :

                <!--#toc_plugin#_START_CONFIGURATION-->
                <!--#toc_plugin#_list_type=ul-->
                <!--#toc_plugin#_start_level=2-->
                <!--#toc_plugin#_end_level=3-->
                <!--#toc_plugin#_header=Page Contents-->
                <!--#toc_plugin#_header_tag=h2-->
                <!--#toc_plugin#_parent_tag=div-->
                <!--#toc_plugin#_parent_tag_id=toc-->
                <!--#toc_plugin#_END_CONFIGURATION-->

                <!--#toc_plugin#_TOC_OUTPUT-->

                <!--#toc_plugin#_START_TOC_INDEXING-->
                <h2>Here is a heading</h2>
                <p>Here is some text</p>
                <h2>Here is another heading</h2>
                <h3>Here is a subheading</h3>
                <h3>Here is another subheading</h3>
                <!--#toc_plugin#_END_TOC_INDEXING-->


                So, exactly the same that in the example given in the plugin.

                Regrettably, tags are not interpreted in the html output. ) That here is:

                <!--#toc_plugin#_START_CONFIGURATION-->
                <!--#toc_plugin#_list_type=ul-->
                <!--#toc_plugin#_start_level=2-->
                <!--#toc_plugin#_end_level=3-->
                <!--#toc_plugin#_header=Page Contents-->
                <!--#toc_plugin#_header_tag=h2-->
                <!--#toc_plugin#_parent_tag=div-->
                <!--#toc_plugin#_parent_tag_id=toc-->
                <!--#toc_plugin#_END_CONFIGURATION-->

                <!--#toc_plugin#_TOC_OUTPUT-->

                <!--#toc_plugin#_START_TOC_INDEXING-->

                <h2 id="here-is-a-heading">Here is a heading</h2>

                <p>Here is some text</p>

                <h2 id="here-is-another-heading">Here is another heading</h2>


                <h3 id="here-is-a-subheading">Here is a subheading</h3>


                <h3 id="here-is-another-subheading">Here is another subheading</h3>

                <!--#toc_plugin#_END_TOC_INDEXING-->
                .

                Did anybody meet a similar problem?


                  • 22797
                  • 134 Posts
                  I just uploaded a newer version. It appears as if the latest version had not been placed on the MODx repository. Give that one a try. If you still have problems, let me know.
                    • 22797
                    • 134 Posts
                    Quote from: astrolabe at Dec 03, 2007, 06:04 AM


                    Just a question :

                    Can y put those tags anywhere ( for example in a template ?) and arround the [*#content*] of my page,...

                    I have used the TOC plugin in templates, chunks, and in page content. It should work in most places.
                      • 2327
                      • 214 Posts
                      Thank you Paul !

                      I test immediatly smiley