3214 Posts in 848 Topics by 810 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1735 Views |
-
SiteMap $rootLevel

20 December 2008 at 12:45pm
How can I present different types in my sitemap.
Standard it only present the rootlevel type Page. What if, for example, there is a articlePage and a Page type?
function SiteMap() {
$rootLevel = DataObject::get("Page", "ParentID = 0"); // Pages at the root level only
$output = "";
$output = $this->makeList($rootLevel);
return $output;
} -
Re: SiteMap $rootLevel

22 December 2008 at 3:06pm
this is easy,
just add the articlePage type to that too
function SiteMap() {
$rootLevel = DataObject::get("Page", "ParentID = 0"); // Pages at the root level only
$output = "";
$output = $this->makeList($rootLevel);
$articlePages = DataObject::get("ArticlePage", "ParentID = 0"); // Pages at the root level only
$output = $this->makeList($articlePages);
return $output;
} -
Re: SiteMap $rootLevel

22 December 2008 at 3:08pm
I forgot to mention, on the first Page.php the make list function can be further edited to make the page levels too, with adding sub lists, and so on.
-
Re: SiteMap $rootLevel

22 December 2008 at 10:09pm
It doesn't seem to work, can you please explain further?
-
Re: SiteMap $rootLevel

23 December 2008 at 12:18pm
Problem solved. Sitemap works fine.
function SiteMap()
{
$output = "";$rootLevel = DataObject::get("SiteTree", "ParentID = 0");
$output = $this->makeList($rootLevel);return $output;
} -
Re: SiteMap $rootLevel

3 April 2009 at 9:09pm
Thanks for posting this, that's has solved my problem too.
| 1735 Views | ||
|
Page:
1
|
Go to Top |



