I upgraded my website from v8 to v9 and it seems that the replace_link_with_first_in_nav attribute no longer works. Should we add this code to the application/bootstrap/app.php file?
`use Concrete\Core\Routing\Redirect;
Events::addListener(‘on_page_view’, function($event) {
$page = $event->getPageObject();
if ($page->getCollectionAttributeValue(‘replace_link_with_first_in_nav’)) {
$sub = $page->getFirstChild();
if (is_object($sub)) {
Redirect::page($sub, 301)->send();
}
}
});`
Hmm it does work for me when I add it in v9.3.2 when I try it on a demo site here.
Not discounting the possibility that it has something to do with going from v8 → v9.
Are you seeing it in an actual Autonav, or in the Top Navigation block or something like that? I think sometimes the Top Navigation block might not have all the attributes honored that the Autonav does.
Hi Evan,
I use Autonav with my own template. Actually, I did a permanent redirection in my htaccess for it to work. I will do a test on fresh install the next time
1 Like