Created
December 21, 2011 13:50
-
-
Save bastianallgeier/1506128 to your computer and use it in GitHub Desktop.
Sitemap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(!isset($subpages)) $subpages = $site->pages() | |
$ignore = array( | |
'blog/feed', | |
'another/hidden/page' | |
); | |
?> | |
<somexml> | |
<?php foreach($subpages->visible() AS $p): ?> | |
<?php if(in_array($p->uri(), $ignore)) continue; ?> | |
... crazy xml ... | |
<?php if($p->hasChildren()): ?> | |
<?php snippet('sitemap', array('subpages' => $p->children())) ?> | |
<?php endif ?> | |
<?php endforeach ?> | |
</somexml> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment