We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2327
    • 214 Posts
    Hello,

    I know wayfinder for renderer a sitemap like :

    --Home
    --Category a
    --PageA
    --PageB
    --PageC
    --Category b
    --PageA....

    But i want also to insert in this sitemap the structure of each page (based on H1-Hn) like :

    --Home
    --Category A
    --Page a
    --Title1 H1
    --Title1 H2
    --Title2 H2
    --Title2 H1
    --Title1 H2
    --Title2 H2
    --Title1 H3
    --Title2 H3
    --page B
    ...
    --Page C
    --Category b
    --Page A....


    I think wayfinder can’t do this.

    I know tow plugin: Automatic Toc http://modxcms.com/extras/repository/packages/toc and Page Toc Generator http://modxcms.com/extras/?package=331 they can insert in a page a table of contents from the page’s headings (H1-Hn..).

    But i don’t now the way to insert automaticaly this results in the global sitemap of the site, eventually with specific Tv placed to the wayfinder Tpl.


    Perhaps a specific plugin exist to do a global site map heading based ?

    Thank you for you help if you have any solution and sorry for my english.
      • 19980 ☆ A M B ☆
      • 275 Posts
      I would better go for Ditto and setup different chunks for some items needed to be in <h1>

        modx and ecommerce pro
        • 2327
        • 214 Posts
        Thank you very much for your help...Ditto isn’t very easy to use for a newbie like me, but it’s appear an excellent way. Perhap’s the only ?

        Thanks !

        Edit : But a french user of Ditto said to me that it’s not possible to obtain this result if the Hn tag are not stored in Template Variable but only in the direct content of the html page (and it’s my case... >:().

        You confirm ?
          • 19980 ☆ A M B ☆
          • 275 Posts
          Hey, you are welcome.

          Quote from: astrolabe at May 28, 2010, 07:35 PM

          --Home
          --Category a
          --PageA
          --PageB
          --PageC
          --Category b
          --PageA....

          here is a possible solution:

          In the page content of your sitemap put Ditto call like:
          [[Ditto? depth=1 &amp;tpl=`SiteMapRoot` ]]

          create chunk called SiteMapRoot: and put there a code:
          <span>[+pagetitle+]</span>

          [[Ditto? depth=`1` &amp;parents=`[+id+]` &amp;tpl=`SiteMapH`]]

          where template SiteMapH would be also a chunk but with the code:
          <span><h1>[+pagetitle+]</h1></span>


          Hope the idea is good and you got the direction

          Let me know, cheers
            modx and ecommerce pro
            • 2327
            • 214 Posts
            Thank you very much....but i understand how the chunk SiteMapH can be work :

            <span><h1>[+pagetitle+]</h1></span><br />


            I look for the title of my H text , not for the title of his current page...
              • 19980 ☆ A M B ☆
              • 275 Posts
              ok

              as far as I know Ditto can parse other page’s standart tvs which are automatically Ditto’s placeholders,
              eg. *longtitle* can be used as Ditto’s placeholder [+longtitle+]. The same for introtext..

              So u can put Page A into introtext of your for page1, then Page B into other pageN. Then make a chunk to output <span><h1>[+introtext+]</h1></span>


              Hope this helps...
                modx and ecommerce pro
                • 2327
                • 214 Posts
                Thanks modx.customize, but it’s not exacly my problem.

                I haven’t just H1 header in my pages, somes H2, H3, Hn....a hierarchy level variable and put this in a Document Variable as Introtext or other is not a serious solution.

                Perhaps a solution is to use the TV generate with autotoc or TocGenerator for include it in a specific TV with WayFinder....

                I show this only way for the moment.

                but I’am extremely surprised to be the first on face with this subject.

                Thanks for your help wink