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.

Installing SilverStripe /

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

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

Tutorial vs mysite / blackcandy


Reply


6 Posts   3347 Views

Avatar
paulkoan

Community Member, 5 Posts

6 February 2009 at 3:29am

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

Avatar
Carbon Crayon

Community Member, 598 Posts

6 February 2009 at 4:00am

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 :)

Avatar
paulkoan

Community Member, 5 Posts

6 February 2009 at 4:07am

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?

Avatar
Carbon Crayon

Community Member, 598 Posts

6 February 2009 at 4:19am

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.

Avatar
UncleCheese

Forum Moderator, 4094 Posts

6 February 2009 at 4:20am

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

Avatar
paulkoan

Community Member, 5 Posts

6 February 2009 at 12:38pm

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?