Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Sitemap Tutorial Problems - Blank Site Map

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 2919 Views
  • sstewart
    Avatar
    Community Member
    12 Posts

    Sitemap Tutorial Problems - Blank Site Map Link to this post

    Newbie alert...

    Just setting up a site

    Following the sitemap tutorial
    (http://doc.silverstripe.com/doku.php?id=tutorial:site-map)

    Got to:
    Look mum, a site map!

    but there isn't one!!!

    Just a blank space where it should be?

    Changing the stylesheet changes the heading "Site Map" but no list of pages...

    How do I find out where the error is in I assume my SiteMap.php?

  • Willr
    Avatar
    Forum Moderator
    5482 Posts

    Re: Sitemap Tutorial Problems - Blank Site Map Link to this post

    have you created a page type of 'Site Map' in the CMS? Have you got the $SiteMap in your template file?

  • sstewart
    Avatar
    Community Member
    12 Posts

    Re: Sitemap Tutorial Problems - Blank Site Map Link to this post

    Yes,

    Page is here

    http://www.younggreens.org.nz/site-map/

    Currently in /mysite/templates/layout
    SiteMap.ss

    ---
    <div class="typography">
       
       <% if Level(2) %>
           <% include BreadCrumbs %>
       <% end_if %>
       
          <h1>$Title</h1>
       
          $Content
          $Sitemap
          $Form
          $PageComments
    </div>
    ---

  • Willr
    Avatar
    Forum Moderator
    5482 Posts

    Re: Sitemap Tutorial Problems - Blank Site Map Link to this post

    Ok well the only PHP error I see is Notice: Undefined variable: rootLevel in /home/nzyg/web/younggreens.org.nz/html/mysite/code/SiteMap.php on line 24 - dont know if that should be there or if somethings not right.

    Looking at the code I think the problem is

    $rootLevel = DataObject::get("Page", "ParentID = 0"); // Pages at the root level only

    I dont think it is returning any objects. Hence why their is not code outputted. if($rootLevel) fails then it doesnt even get to that stage. Try add a die('test') inside the if($rootLevel) {} and see if it dies with test - If im correct it won't it will skip that if entirely. Now the question is why..

  • sstewart
    Avatar
    Community Member
    12 Posts

    Re: Sitemap Tutorial Problems - Blank Site Map Link to this post

    Okay cool I figured out how to debug code on the remote server. (For any other newbies)
    append ?isDev=1 to url.

    Okay fixed that problem.

    Now can't see any errors using the above

    But still blank...

    I can't understand this now works on my test site on my local machine but not on remote site.

  • shauna
    Avatar
    Community Member
    7 Posts

    Re: Sitemap Tutorial Problems - Blank Site Map Link to this post

    I am having exactly the same problem. Any insights to solving the issue would be appreciated.

    Thanks

  • sstewart
    Avatar
    Community Member
    12 Posts

    Re: Sitemap Tutorial Problems - Blank Site Map Link to this post

    Still haven't resolved this issue myself but haven't had time to spend working through this issue recently.

  • evren
    Avatar
    Community Member
    37 Posts

    Re: Sitemap Tutorial Problems - Blank Site Map Link to this post

    Nice !!!
    Checked the docs about, create one. Also there was a nice CSS code on tutorial.
    But I dont know how to apply the given CSS code to the sitemap. Where or which file needs to edit?

    Thanks for your reply in advance

    2919 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.