Jump to:

4951 Posts in 13998 Topics by 1491 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » Tutorial vs mysite / blackcandy

Getting SilverStripe up and running on your computer and on your web server.

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

Page: 1
Go to End
Author Topic: 3274 Views
  • paulkoan
    Avatar
    Community Member
    5 Posts

    Tutorial vs mysite / blackcandy Link to this post

    Hello,

    I am trying to understand the difference between the tutorial and the mysite/blackcandy install options.

    Tutorial 1 says that tutorial and mysite have the same structure - which they do, except mysite contains _config.php, and tutorial doesn't (when I installed with blackcandy).

    If I had selected tutorial, then tutorial/templates/Page.ss would be the main template. However, I installed blackcandy, which means Page.ss is in themes/blackcandy/templates.

    I am assuming that the _config.php "theme" directive is telling silverstripe not to look in mysite/templates for the template, but in the theme folder. Is that right?

    My question is this - where in the config does it get defined that silverstripe should be looking in mysite or in turorial in the first place? Is this just set at install time and isn't changable post install (through the gui etc?).

    Thanks,

    Paul

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: Tutorial vs mysite / blackcandy Link to this post

    Hi Paul, welcome to Silverstripe

    The project directory gets set in the main _config file at the top:

    global $project;
    $project = 'mysite';

    So this tells silverstripe to use the mysite directory as the first place to look for code/template/css/image/js files. If a theme is also set in the config (SSViewer::set_theme('themeName'), then this is the second place SS will look for template/css/image files.

    It doesn't matter whether the _config file is in the mysite or tutorials directory, SS will still follow the directives contained within it. Generally SS will process any folder with a _config.php file and the relative folders (code/templates etc.) contained within it. this is how it knows to install modules that have just been copied into the root.

    Hope that helps

  • paulkoan
    Avatar
    Community Member
    5 Posts

    Re: Tutorial vs mysite / blackcandy Link to this post

    That does help - only my root doesn't have a _config.php file in it.

    I suppose I might have deleted it by accident - but still, how then does ss know where the site is right now?

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: Tutorial vs mysite / blackcandy Link to this post

    Sorry that might have been a little confusing

    There shouldn't be a _config.php in the root, SS will look through all the folders in the root to find the _config.php files. One of those files (usually in 'mysite') will set the $project variable and the theme, as well as the database connection values. SS will then use that project folder as it's first port of call for project files and the current themes folder (if set) as it's second.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Tutorial vs mysite / blackcandy Link to this post

    This is really confusing. See this thread http://www.silverstripe.org/general-questions/show/252878

  • paulkoan
    Avatar
    Community Member
    5 Posts

    Re: Tutorial vs mysite / blackcandy Link to this post

    Thanks guys. "It scans the root folders for _config.php" was unexpected behaviour!

    The other post had reference this being to enable multisite setups with a single ss install. Is that right? What happens if there are two _config.phps to be found, or does it just go with the first one found?

    3274 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.