Page visible = false but reachable with the browser?


#1

Hi again,

i have some invisible pages as part of another page. But you can reach those “part pages” with the browser. Is it possible to hide them from the navigation?

Thx for help.


#2

You could route people trying to visit your “part pages” elsewhere, eg to their parent page:

// Routes

c::set('routes', array(
  array(
    'pattern' => 'parent-page/(:any)',
    'action'  => function() {
       go('parent-page');
    }
  )
));

Read more about this in Kirby’s documentation.


#3

These are two different issues.

  • to hide them from the navigation, filter nav items by visibility status.
  • to make these pages inaccessible via the browser (i.e. if they are called manually)use a route or add a redirect in your templates.

#4

Thx it works.

I have different urls for the languages so i always need routes * language? Or is there a unique url identifier?


#5

You need routes per language if you use URL-keys.


#6

thanks for your help!