Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Rename 'Home' Page to 'Welcome' - dev/build creates new homepage :(


Go to End


7 Posts   3025 Views

Avatar
borriej

Community Member, 267 Posts

4 May 2010 at 10:57pm

Edited: 04/05/2010 11:17pm

Hello,

is it possible to rename the 'home' page to 'Welcome'?

I've renamed it in the CMS, but when I run a dev/build SilverStripe shouldn't think: oh 'home' page is missing, lets create one.

When I rename 'home' in the CMS to 'Welcome' it must be recognized as the home page So after dev/build it shouldn't create 'home' again.

Is this possible?

Ty!

Avatar
dhensby

Community Member, 253 Posts

5 May 2010 at 10:23am

This is unfortunately caused by the Require default records function of SiteTree. It may be possible to over-ride this function with a decorator. Or, if you don't mind editing core files, you could just delete it! But that is naughty.

Hope that helps

Avatar
DeklinKelly

Community Member, 197 Posts

24 August 2010 at 12:44pm

I also need a solution for this. Has anyone created a working hack for this?

Avatar
Willr

Forum Moderator, 5523 Posts

24 August 2010 at 8:26pm

It should only create a Homepage when no page with the URL 'home' is found. As long as you leave the page with the URL 'home' (note the URL is normally rewritten to / anyway) it will be fine. When renaming the page to 'Welcome' just click cancel on the change URL prompt. If you want to change the URL to welcome as well your asking for trouble.

Avatar
Devlin

Community Member, 344 Posts

24 August 2010 at 8:34pm

Edited: 24/08/2010 8:36pm

You can add SiteTree::set_create_default_pages(false); into your config.
But if the URLSegment 'home' isn't found in the SiteTree, SS will redirect to the first page e.g. 'welcome'. So it is better to maintain the Welcome Page with the URLSegment 'home'.

Avatar
DeklinKelly

Community Member, 197 Posts

25 August 2010 at 12:18am

Thank you.

I posted a related question here:
http://www.silverstripe.org/general-questions/show/290923

Avatar
jthomerson

Community Member, 5 Posts

3 February 2012 at 4:39am

I created a pull request for 2.4.x to add the ability to override the homepage URL segment. Hopefully it will get used to provide this functionality.

https://github.com/silverstripe/sapphire/pull/182