We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29181
    • 480 Posts
    Quote from: Leftblank at Dec 31, 2006, 05:43 AM

    Did you upload the stylesheet into that folder and renamed it to match the ’sitemap.xsl’ format? By default it has another filename.

    Firstly, thanks for answering smiley

    I have not created or uploaded any stylesheets for this snippet at all.

    I wasn’t even aware that I needed to if I’m using a blank template. I was under the impression I just needed to carry out the steps I already mentioned. Any idea how I would go about creating a stylesheet and renaming it to match the sitemap.xsl format as you suggested? Even the default name would be a good start so I can hunt for it and possibly tweak it to get it to work (big if). On a sidenote http://localhost/cms/modx-0.9.5/modx-0.9.5/ is my root directory. I am trying out numerous CMS systems trying to find one with:
    Lots of functionality that I can sort out for clients initially or repeatably (as is normally the case)
    A helpful community
    A simple backend that clients can use to insert content without hours of training. (The pitfall of Typo3 imo)

    But that is by the by, once again thanks for answering and I hope you can help me further.

    Taff
      Adrian Lawley: www.adrianlawley.com
      • 16885
      • 255 Posts
      Quote from: Taff at Dec 31, 2006, 12:44 PM

      Firstly, thanks for answering smiley

      I have not created or uploaded any stylesheets for this snippet at all.

      I wasn’t even aware that I needed to if I’m using a blank template. I was under the impression I just needed to carry out the steps I already mentioned. Any idea how I would go about creating a stylesheet and renaming it to match the sitemap.xsl format as you suggested? Even the default name would be a good start so I can hunt for it and possibly tweak it to get it to work (big if). On a sidenote http://localhost/cms/modx-0.9.5/modx-0.9.5/ is my root directory. I am trying out numerous CMS systems trying to find one with:
      Lots of functionality that I can sort out for clients initially or repeatably (as is normally the case)
      A helpful community
      A simple backend that clients can use to insert content without hours of training. (The pitfall of Typo3 imo)

      But that is by the by, once again thanks for answering and I hope you can help me further.

      Taff
      I think you’ve skipped this step, it explains how to upload the stylesheet in order to (visually) check the validness of your generated sitemap in your browser. It’s not neccesary to upload it, but it’s helpful as this stylesheet shows exactly what’s wrong - if theres anything - rather than that you’d have to look in the source yourself and try to spot mistakes. You can see a demo if this on my website. Hopefully this is enough info for now wink You’re welcome wink

      Addition: grad, right now if a document doesn’t have a ’last modified date’ set (which happens if you use the NewsPublisher snippet) then it’ll show ’1970-01-01’ in the sitemap; I think it would be better to use the ’created on date’, for SEO wink
        • 29181
        • 480 Posts
        Excellent leftblank, thanks for all the help smiley
          Adrian Lawley: www.adrianlawley.com
          • 36541
          • 222 Posts
          Quote from: Leftblank at Jan 01, 2007, 06:47 AM

          Addition: grad, right now if a document doesn’t have a ’last modified date’ set (which happens if you use the NewsPublisher snippet) then it’ll show ’1970-01-01’ in the sitemap; I think it would be better to use the ’created on date’, for SEO wink

          Thanks for pointing this out. I am aware of a few issues, which exist in the 1.0.2 and I plan to do a major rewrite of the snippet in the near future. I hope smiley
            This is the web: the only thing you know about who will come is that you don't know who will come.
            • 21136
            • 103 Posts
            Hello smiley

            I am also having some issues with showing and hiding pages from the sitemap.

            As a quickfix to the existing code - could you ad to the call to include all folders,docs,weblinks that are "searchable".

            I think that would do the trick.

            Do you think that would be possible before starting the total re-write?

            My php skills aren’t versed enough to do it myself or I would smiley

            Regards,

            Ken Roberts
              • 36541
              • 222 Posts
              Quote from: nekstrebor at Jan 17, 2007, 07:50 PM

              As a quickfix to the existing code - could you ad to the call to include all folders,docs,weblinks that are "searchable".

              Hiding documents from being included in the sitemap is really a straitforward task (apart from the weblink issue). If you know the document should be hidden permanently use the template to hide it; if you want to hide it temporarily, then use a tv. Follow the documentation and there should be no problems.

              I’m really busy at my daywork for few weeks now and just can’t spare more time on that task. Sorry.
                This is the web: the only thing you know about who will come is that you don't know who will come.
                • 24981
                • 109 Posts
                Hi,

                Is there any way to get this Snippet to display pages that are nested within Unpublished folders. My blog pages are accessed via the Ditto Snippet, so are inside an Unpublished folder.

                Richard
                  • 36541
                  • 222 Posts
                  Quote from: ricardosanX at Jan 24, 2007, 05:42 AM

                  Is there any way to get this Snippet to display pages that are nested within Unpublished folders. My blog pages are accessed via the Ditto Snippet, so are inside an Unpublished folder.

                  Try this:

                  <?php
                  # @line 119
                  if (!$doc[$excludeTV]) // remove
                  if (!$doc[$excludeTV] && $doc['published'] && $doc['template']!=0) // add
                  
                  # @line 198
                  $docs = $modx->getActiveChildren($startid,'menuindex','asc','id,editedon,template'); //remove
                  $docs = $modx->getAllChildren($startid,'menuindex','asc','id,editedon,template,published'); // add
                  
                  # @line 206
                  if ($modx->getActiveChildren($id)) // remove
                  if ($modx->getAllChildren($id)) // add
                  ?>


                  The change includes also filtering out documents with no template inteded for weblinks.
                    This is the web: the only thing you know about who will come is that you don't know who will come.
                    • 24981
                    • 109 Posts
                    Thanks - it works!

                    Richard
                      • 4544
                      • 3 Posts
                      Hi,
                      I followed the instructions on the wiki and keep getting the same error when I try to access the sitemap.
                      (mysite.com/sitemap.xml) and in the manager by clicking on the document.

                      error...

                      XML Parsing Error: undefined entity
                      Location: http://localhost/modx/index.php?id=1468&z=manprev
                      Line Number 2, Column 56: <html><head><title>MODx Content Manager &raquo; </title>

                      and the source code...

                      <html>
                      <head>
                      <title>MODx Content Manager &raquo; </title>
                      <style>TD, BODY { font-size: 11px; font-family:verdana; }</style>
                      <script type=’text/javascript’>
                      function copyToClip()
                      {
                      holdtext.innerText = sqlHolder.innerText;
                      Copied = holdtext.createTextRange();
                      Copied.execCommand(’Copy’);
                      }
                      </script>
                      </head>
                      <body>
                      <h3 style=’color:red’>&laquo; MODx Parse Error &raquo;</h3>

                      <table border=’0’ cellpadding=’1’ cellspacing=’0’>
                      <tr><td colspan=’3’>MODx encountered the following error while attempting to parse the requested resource:</td></tr>
                      <tr><td colspan=’3’><b style=’color:red;’>&laquo; PHP Parse Error &raquo;</b></td></tr>
                      <tr><td>&nbsp;</td></tr><tr><td colspan=’3’><b>PHP error debug</b></td></tr>
                      <tr><td valign=’top’>&nbsp;&nbsp;Error: </td><td colspan=’2’>Invalid argument supplied for foreach()</td><td>&nbsp;</td></tr>
                      <tr><td valign=’top’>&nbsp;&nbsp;Error type/ Nr.: </td><td colspan=’2’>Warning - 2</b></td><td>&nbsp;</td></tr>
                      <tr><td>&nbsp;&nbsp;File: </td><td colspan=’2’>C:\mysite\manager\includes\document.parser.class.inc.php(748) : eval()’d code</td><td>&nbsp;</td></tr>
                      <tr><td>&nbsp;&nbsp;Line: </td><td colspan=’2’>146</td><td>&nbsp;</td></tr>
                      <tr><td>&nbsp;</td></tr><tr><td colspan=’3’><b>Parser timing</b></td></tr>
                      <tr><td>&nbsp;&nbsp;MySQL: </td><td><i>0.0217 s</i></td><td>(<i>6 Requests</i>)</td></tr>
                      <tr><td>&nbsp;&nbsp;PHP: </td><td><i>0.2716 s</i></td><td>&nbsp;</td></tr>
                      <tr><td>&nbsp;&nbsp;Total: </td><td><i>0.2933 s</i></td><td>&nbsp;</td>
                      </tr>
                      </table>
                      </body>
                      </html>

                      I am not running any plug ins, fceditor etc. Most of the forums related to parse errors seems to stem from these but I don’t use any and still I get this error. The other cause from the forum topics seems to be modx trying to read the document as an html file rather than xml, I do have friendly urls/alias turned on with .html as a suffix but if I turn that off I still get the same error. Has anybody else had the same problem? Or does someone get why this is happening and can point me in the right direction, thanks.