Let’s say I have 4 pages (default template) and one blog page (blog template). Now I want to make the blog the index (home page) of my site. Is it possible to make this change? Even if I remove the current home page from the content folder, I can’t change the url of the blog page to “/”. Suggestions?
If you want to do this from the Panel, you have to wrap this option within the ready setting to set the home page according to a site field selected in the Panel (since you can’t use kirby() and site() outside of the ready option in the config)
Hm, maybe the option kicks in too late, just tested myself, and. when I dump $kirby->options() in a template it outputs the right option setting, but you are right, it is ignored…
This works. The only issue I’m having is if I set the blog as my homepage, the code doesn’t redirect example.com/blog to example.com thus having two urls to the same page.
This makes it just a little inconsistent. If for example you have (my header):
-> If I click on the “Logo” it will take me to the blog example.com
-> If I click on the “Blog” link it will also take me to the blog but example.com/blog
You wouldn’t have the issue if you just set the home page to blog in the config, without making it configurable through the Panel. Why is this necessary? I don’t think it makes sense to change this ever so often.
Ok here’s my issue:
If my main page is my blog:
1_home (title of the page is Blog)
2_about
…
Now all my blog posts will have the following urls: example.com/home/my-blog-post
What’s the easiest way to change the slug from the panel? I was thinking to have an input field in the settings where you can change the slug of the home page but not sure.
I know you can add 'home' => 'blog' to config.php but then you also need to rename the folder to blog.