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

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

    Brief Description:
    Automatically generate a page-specific table of contents from the page's headings. Configurable, stylable.
      • 27889
      • 415 Posts
      Good plugin you write here (better than mine smiley ) .

      Just an idea, I notice that when you search for a header tag you search for [tt]<$header_tag> [/tt], wouldn’t be better to search for a kind of [tt]<$header_tag(.*)>[/tt] so you can find header with attribute.
        MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
        MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
        • 22797
        • 134 Posts
        Quote from: Soda at Jan 21, 2007, 01:34 AM

        Just an idea, I notice that when you search for a header tag you search for [tt]<$header_tag> [/tt], wouldn’t be better to search for a kind of [tt]<$header_tag(.*)>[/tt] so you can find header with attribute.

        That is a good suggestion. As soon as that is finished, I’ll post an update, but that may not be for a few more days, since we’re working on a number of projects at the same time.

          • 6726
          • 7,075 Posts
          Very cool paulb, I’ll try it out it will certainly be very useful for online documentation or editorial content... nice !
            .: COO - Commerce Guys - Community Driven Innovation :.


            MODx est l&#39;outil id
            • 22797
            • 134 Posts
            I made some corrections to the documentation. The corrected usage example looks like this (I originally left off the "#toc_plugin#_" part on some of the lines. Sorry about that:

            <!--#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-->
              • 32669
              • 20 Posts
              Hi,

              I love your plugin but there’s something going wrong with my website, your plugin takes away my <h> tags and thus my header tags aren’t properly styled anymore..

              Can you help me out?

              Wouter
                • 22797
                • 134 Posts
                If you could post the way the code looks before (in MODx) and after (the way it is rendered in the browser), that might help diagnose the problem.
                  • 32669
                  • 20 Posts
                  <h2 align="center">><span lang="EN-US" style="font-family: Arial Rounded MT Bold"><span style="font-family: georgia,palatino">Dance on My Grave Assignment</span</span</h1>


                  turned into

                  <a name="Theme_Death_1" id="Theme_Death_1"></a><span lang="EN-US" style="font-family: Arial Rounded MT Bold"><span style="font-family: georgia,palatino">Theme: Death</span></span></h0>
                    • 22797
                    • 134 Posts
                    You’ve found a bug. It appears that the plugin fails when you have attributes in the heading tag. I’ve mentioned this to the programmer, and he’ll post an update when he gets the chance. In the meantime, you could align the heading some other way. For example, in the style sheet, you could do something like this:

                    h2 {
                    text-align:center;
                    }

                    Note: You may also want to clean up the code a bit. You’ve got a stray ">" after the opening h2 tag, and your closing tag does not match the opening tag (closing tag is h1, opening tag is h2). Fixing these things won’t fix the plugin, but it will improve your page a bit.
                      • 22797
                      • 134 Posts
                      The code has been updated. You can now have attributes in header elements, e.g. <h2 align="center">