Automatic URL manipulation via header.routes.default


#1

Hello together,
I would like to remove the /folder/ part from the url. (The parent folder)
I wrote
header.routes.default:
type: text
autofocus: true
style: vertical
label: Meine URL
default: "/"
into the system/blueprints/pages/default.yaml and it works fine.

Now, I would like to create or save the page and the header.routes.default should be written automatically into the default . md and especially it should be written default: “/foldername”

So I wouldn’t need a extra field on my content area and it wouldn’t be written manualy.

Thank you in advance.
Best regards
dci


#2

Hello,
I believe, I solved my issue by myself.
On the file system/src/Grav/Common/Page/Page.php I expanded the function frontmatter.
$this->frontmatter = (string)$var.“routes: \n default: /”.preg_replace(PAGE_ORDER_PREFIX_REGEX, ‘’, $this->folder);
works fine for me.
Sure, I shouldn’t work on /system/src … but what should I do?
I think it would be more comfortable, if I could set it folder by folder (functionality like home-folder) via true or false on the admin panel.
dci