Jump to:

17488 Posts in 4473 Topics by 1978 members

Archive

SilverStripe Forums » Archive » First Page instead of URLSegment = /home

Our old forums are still available as a read-only archive.

Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo

Page: 1
Go to End
Author Topic: 883 Views
  • stefant42
    Avatar
    Community Member
    12 Posts

    First Page instead of URLSegment = /home Link to this post

    Is it possible to teach Silverstripe to use the First Page of Sitetree instead of searching for the URLSegement "/" or "/home"..

  • carlos
    Avatar
    Community Member
    40 Posts

    Re: First Page instead of URLSegment = /home Link to this post

    Hi,

    just checked, it will use the first page in the SiteTree as the home page, not matter the name of the page.
    you'll need to check the version of SS you are using.

    cheers

  • stefant42
    Avatar
    Community Member
    12 Posts

    Re: First Page instead of URLSegment = /home Link to this post

    I'm still using SS 2.3.4 with the subsite module... Is it possible, that the subsite module make it happen?

  • stefant42
    Avatar
    Community Member
    12 Posts

    Re: First Page instead of URLSegment = /home Link to this post

    You can solve the Problem in

    class RootURLController extends Controller {
       
       /**
        * @var boolean $is_at_root
        */
       protected static $is_at_root = false;
       
       /**
        * @var string $default_homepage_urlsegment Defines which URLSegment value on a {@link SiteTree} object
        * is regarded as the correct "homepage" if the requested URI doesn't contain
        * an explicit segment. E.g. http://mysite.com should show http://mysite.com/home.
        */
       protected static $default_homepage_urlsegment = 'home';

    see    protected static $default_homepage_urlsegment = 'home';

    883 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.