New to Kirby and really enjoying the development experience so far
I’ve had an issue whilst trying to customise parts of my folder structure that should be configurable according to the documentation. I’d like to relocate the ./assets/avatars and ./thumbs folders, which are both configurable paths in $kirby->roots which were used as below according to the documentation.
However, the Panel plugin no longer works whilst these lines are present, not loading at all in a browser. I’ve tried other folder locations and isolating one customisation at a time, but any path modification seems to break the Panel. At all stages, the referenced directories were present and correct, and whilst testing I even left them in both locations — so it seems it is simply setting these keys that is upsetting the plugin.
If someone has any idea on a possible cause or can offer any help, it would be much appreciated. I’d just really like to relocate these (particularly ./thumbs in the root!), and as a first-party plugin, any global configuration changes shouldn’t be breaking things :\
Oh, my bad — for the question I cut down the full path for simplicity and accidentally removed the first . DS . here, but it has been present in my source code (amended above now).
More information
When inspecting the blank Panel page with my site.php active it is trying to load assets from a different URL:
And causing the problem is the additional panel/ directory reference. Interestingly, if I then visit http://localhost/projects/kirby-starter/panel/panel/, part of the markup for the panel loads! The paths have got confused somewhere. I would prefer not hacking to fix this, as I have Panel as a Git submodule.
Can you explicitly add what/how/where you set $kirby->urls->index ? I’ve run up against the same issue, and am not sure what you set the index to to fix the problem!
I added this line to config.php to set the site URL - hope this helps
/*
---------------------------------------
URL Setup
---------------------------------------
By default kirby tries to detect the correct url
for your site if this is set to false, but if this should fail
or you need to set it on your own, do it like this:
c::set('url', 'http://yourdomain.com');
Make sure to write the url without a trailing slash.
*/
c::set('url', 'http://localhost:8000');
The site.php file where you define your paths is loaded before Kirby even knows where your config file is (you can modify that path as well). So you can’t get the value from the config.