kaloja
April 3, 2018, 7:45am
1
Hi,
I’m looking for a routing pattern that match all site pages but not panel pages. I thought I solved it with 'pattern' => '(.+)'
but it turned out later during the development that this target even the panel pages which create a conflict with Pedro Borges GitHub - pedroborges/kirby-page-lock: ⬢ Page Lock helps prevent content loss by putting a temporary lock on pages being edited on the Panel. .
Is there anyone here who is a pro at php regex?
I’m not so sure you have to exclude panel pages here, but rather those page-lock routes? Can’t really test this because the page lock plugin throws lots of errors in my console with or without a route.
kaloja
April 3, 2018, 12:17pm
3
Thanks for your input. I will try that. Do you know how to exclude patterns with Kirby routing?
Example not working
'pattern' => '(!page-lock)(.*)', // Match all except page-lock
Maybe something like this (not tested):
'pattern' => '(^(?!.*page-lock).+$)',
I suggest that you check your pattern with https://regex101.com
kaloja
April 3, 2018, 12:32pm
5
Perfect, it works. I’ll bookmark that link.