4622 Posts in 1398 Topics by 1393 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1076 Views |
-
How SS chooses a directory

9 March 2009 at 5:08pm
Hi,
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?
My details:
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/adminThanks.
-
Re: How SS chooses a directory

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.
-
Re: How SS chooses a directory

10 March 2009 at 1:09am
Sam,
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:
auth_openid
cms
sapphire
tutorialbut only tutorial has $project.
-
Re: How SS chooses a directory

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.
-
Re: How SS chooses a directory

10 March 2009 at 11:48am
Sam,
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.
| 1076 Views | ||
|
Page:
1
|
Go to Top |


