Skip to content

Instantly share code, notes, and snippets.

@bastianallgeier
Created December 21, 2011 13:50
Show Gist options
  • Save bastianallgeier/1506128 to your computer and use it in GitHub Desktop.
Save bastianallgeier/1506128 to your computer and use it in GitHub Desktop.
Sitemap
<?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