Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

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

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

Sitemap Tutorial Problems - Blank Site Map


Reply


8 Posts   2979 Views

Avatar
sstewart

Community Member, 12 Posts

30 July 2008 at 9:10pm

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?

Avatar
Willr

Forum Moderator, 5513 Posts

30 July 2008 at 10:42pm

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

Avatar
sstewart

Community Member, 12 Posts

30 July 2008 at 11:30pm

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>
---

Avatar
Willr

Forum Moderator, 5513 Posts

31 July 2008 at 8:24am

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..

Avatar
sstewart

Community Member, 12 Posts

31 July 2008 at 10:21am

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.

Avatar
shauna

Community Member, 7 Posts

2 September 2008 at 12:04pm

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

Thanks

Avatar
sstewart

Community Member, 12 Posts

2 September 2008 at 10:12pm

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

Avatar
evren

Community Member, 37 Posts

12 October 2008 at 1:48am

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