Panel, Custom Config Path

Hey Kirby-Friends,

I’ve got a Panel-Problem:

I’ve moved my config file, so I can have one kirby-instance for multiple sites. In site.php I added:

$kirby->roots->config = 'sites/SITENAME/config';

it works fine direktly on the page. Routes and all that other stuff is working. But the panel doesn’t work anymore. Looks like it’s ignoring this setting completely. It’s saying there is no valid licence key and my custom panel css isn’t loaded as well.

Do I have to tell the panel, where to find the config in addition to my changes in site.php?

Thanks!
Maurice

That shouldn’t be necessary. What do you mean by “the Panel does not work?” If you see a message with the missing license key, it seems you can log into the Panel?

Yes, sorry, I wasn’t clear enough.
I can log in and I can see the list of pages I have.

As mentioned, I do get the licence error (but the licence key is in the config.php)
I can click on any page, but there is no content in it. I think this is, because I changed the extension from .txt to .md in the config.php
I cannot switch the language
It doesn’t load my custom panel css

So it looks like, it is ignoring/not reading my settings in the moved config.php

A you can see here, it also shows the wrong path (but that may be a static text-block).

Ok, thanks for clarifying. The site.php is loaded by the panel in /panel/index.php, but I haven’t quite found out what happens then.

/ check for a custom site.php
if(file_exists($index . DS . 'site.php')) {
  // load the custom config
  require($index . DS . 'site.php');
} else {
  // create a new kirby object
  $kirby = kirby();
}

I did some simple searches for
$kirby->roots->config and couldn’t really find anything which looks like the config is parsed. So maybe that path is hardcoded anywhere?

I’m trying to find it… but I have to leave for the moment…

@mauricehh Have you already tried with a preceding slash:

<?php
$kirby = kirby();
$kirby->roots->config = '/sites/SITENAME/config';

Is that on localhost or on a server? Make sure that you include the full path to the folder.

For example, on my Mac I put the config file in /Users/username/htdocs/config for testing, so my site.php configuration has to look like this:

<?php
$kirby = kirby();
$kirby->roots->config = '/Users/username/htdocs/config';

for both the frontend and the Panel to work correctly.

Using the full path to document-root + config-path works :slight_smile:
I am now doing:

$docRoot = server::get('DOCUMENT_ROOT');
$kirby->roots->config = $docRoot.'/sites/SITENAME/config';

Setting the other roots, like thumbs or content-folder, works without docRoot.

Thank you for your help @texnixe :slight_smile: