4945 Posts in 17703 Topics by 1494 members
|Go to End|
6 February 2009 at 3:29am
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?).
6 February 2009 at 4:00am
Hi Paul, welcome to Silverstripe
The project directory gets set in the main _config file at the top:
$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
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?
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.
6 February 2009 at 4:20am
This is really confusing. See this thread http://www.silverstripe.org/general-questions/show/252878
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?
|Go to Top|