Why is it crazy? I just re-built the event and news systems which took me about 4 hours each in CodeIgniter in about 40 minutes using PW.
The system is great, though I have some problems with my nav.
I want it to show almost all pages of my site, excluding the children of news/ and events/.
This is how I started:
function nav(Pages $pages)
{
$root = $pages->get('/');
echo '<li><a href="'.$root->url.'">'.$root->title.'</a></li>';
navElement($root);
}
function navElement(Page $site)
{
$sites = $site->children;
foreach ($sites as $site)
{
echo '<li><a href="'.$site->url.'">'.$site->title.'</a>';
if ($site->numChildren)
{
echo '<ul>';
navElement($site);
echo '</ul>';
}
echo '</li>';
}
}
// And then use
nav($pages);
How would you to that? I thought about something like
$hideChildren = array(1010, 1011);
// ...
if ($site->numChildren and ! in_array($site->id, $hideChildren))
An other way would be just to hide those pages but I want to keep them searchable and I think there's no way to auto-hide sites of a specific template, is there?
Thanks for Processwire and your help