Hello guys,
Although I have already built a web-site with ProcessWire, I'm still feeling new at ProcessWire developing. So, I have one question regarding this topic. I want to shorten my urls. I did what WillyC told in the first post. And I get my link shortened successfully. However, the page content does not display, shows only header content. What I'm doing wrong? Should I do something additionally?
My code in the top of _head.php file:
<?php
$pages->addHookAfter('Page::path', null, 'hookPagePath');
function hookPagePath(HookEvent $e) {
$page = $e->object;
if ($page->template == 'services') $e->return = "/$page->name/";
}
?>
Thanks!