C::set home dynamically

Is it possible to set home to the first subpage of page i.e., like this:

c::set('home', $page('photography')->children()->first()->url());

No, unfortunately not – the config is loaded before the page tree and therefore doesn’t have access to that.

You could however create a route for / that handles requests for the homepage and either redirects them to the desired page or renders that page directly. The c::set('home') option would then be left as the default value and a “dummy” homepage would be created that is only used by Kirby internally and otherwise not used for the site.

Alright, thank you.