We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13993
    • 100 Posts
    Sitemaps are currently based around the document either being searchable or shown in menu. I think there are times when those solutions are not flexible enough. So here is a hack for the core to create a ducument setting to "show in sitemap".

    Here are the files I edited for the manager
    #manager\processors\save_content.processor.php DONE
    #manager\processors\duplicate_content.processor.php DONE
    #manager\includes\lang\english.inc.php DONE (Someone else want to handle the translations?)
    #manager\actions\mutate_content.dynamic.php DONE
    #manager\actions\import_site.static.php DONE
    #manager\actions\document_data.static.php DONE
    #manager\actions\mutate_settings.dynamic.php DONE

    Heres a list for the install
    #install\setup.info.php
    #install\setup.sql

    I attached a file with the changes as they where just too long for a post.

    OK I think this is good to go. Can anyone see something I missed? It’s working for me but I want to make sure I got all the places where this needs to be done.

    I originally started to edit the Quick Edit and DocManager modules but I left them out for now. They aren’t really needed to make the hack work and I don’t have enough experience with them to edit them with confidence.
      • 13993
      • 100 Posts
      OK and here are the modified wayfinder files to take advantage of the new settings.

      Example Usage
      [[Wayfinder? &startId=`0` &siteMap=`1`]]

      Note that if you set &siteMap to 1 that the ignoreMenu will be overidden. &siteMap = 1 looks to see in the DB is "Show in Sitemap" is set to true and the document is published. Whether it is set to show in menu means nothing.

      Anyone else care to test this out? I can’t find any issues so far.
        • 23491 ☆ A M B ☆
        • 1,056 Posts
        Killer mod! ...Let’s see if you can get this pushed into the core-release!

        Show in Sitemap is a must-have!
          Mike Reid - www.pixelchutes.com
          MODx Ambassador / Contributor
          [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
          ________________________________
          Where every pixel matters.
          • 13993
          • 100 Posts
          I think they ended saying it was better off using a TV.
          http://modxcms.com/forums/index.php/topic,7771.msg56003.html#msg56003

          I still think something like the sitemap issue should be a core release, but that’s just my opinion. I know there are some huge changes for 1.0 coming. So no telling how it will all work then.
            • 727
            • 502 Posts
            I used this snippet to generate a site map, and it works great - no core mods needed:

            http://modxcms.com/forums/index.php/topic,3914.0.html

            If you want to hide published documents from it (which I did), then put them under a parent document and make that parent unpublished.

            The only thing it doesn’t do is list the pages alphabetically, but that should be easy to do, if needed. Not sure why this snippet isn’t in the repository.

            Andy