4952 Posts in 14257 Topics by 1491 members
|Go to End|
9 March 2009 at 5:08pm
I'm new to SS. I've installed it and run through the tutorials successfully . Here's my question. How does SS know to use the templates and code from the tutorial directory? Why doesn't it use the mysite directory?
running on Fedora 7 with apache
installed in /var/www/html/SilverStripe
accessing my site using the url http://localhost/SilverStripe
accessing the CMS using the url http://localhost/SilverStripe/admin
9 March 2009 at 5:17pm
It looks for the presence of a non-empty _config.php inside every top-level directory. It treats each directory that matches that criterion as "part of the silverstripe code".
After including each of the _config.php files, it then looks at the value of the $project variable, which is set to "mysite" in mysite/_config.php. It then treats that as the "project directory" and all the other folders as "module directories". In practise, the difference between the project directory and the module directories is very small: templates in the project directory will take precedence of those in other modules, if there's a conflict.
10 March 2009 at 1:09am
Thanks for the prompt and thorough reply. It leaves open one question though: what happens if more than one top-level _config.php has a $project defined with different values?
Of course, ny installation is consistent: I have a number of top-level _config.php files:
but only tutorial has $project.
10 March 2009 at 10:36am
"what happens if more than one top-level _config.php has a $project defined with different values?"
Bad things. Don't do it. :-P
Technically, it would use the $project value of the last _config.php file that gets included, which I believe would be the last one in the alphabet. But, like I say, a site with two $project values set is better thought of as a broken site.
Modules and core never set $project.
10 March 2009 at 11:48am
Excellent. Thanks so much for your help. If your attention is typical of the way things work with SilverStripe, I will enjoy working with it a lot.
|Go to Top|