ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Hidden configuration variable per site

September 05, 2010 3:13am

Subscribe [3]
  • #1 / Sep 05, 2010 3:13am

    bjyama

    38 posts

    I use a modified config file to make it easy when moving sites from server to server. I have never used this config file with the MSM.

    I normally override the CP and define the site template directory like this:

    $config['tmpl_file_basepath']     = "/absolute/path/public_html/templates/";

    This works just fine for one site but when I I use it with the MSM it sets both sites to that path.

    Is there a way to set this config variable per site?

  • #2 / Sep 05, 2010 5:22pm

    Greg Salt

    3988 posts

    Hi B.J.

    In each site’s index.php file you can set config variables. Have a look at the $assign_to_config array where you could set this variable:

    /*
     * --------------------------------------------------------------------
     *  CUSTOM CONFIG VALUES
     * --------------------------------------------------------------------
     *
     * The $assign_to_config array below will be passed dynamically to the
     * config class. This allows you to set custom config items or override
     * any default config values found in the config.php file.  This can
     * be handy as it permits you to share one application between more then
     * one front controller file, with each file containing different 
     * config values.
     *
     * Un-comment the $assign_to_config array below to use this feature
     *
     * NOTE: This feature can be used to run multiple EE "sites" using
     * the old style method.  Instead of individual variables you'll
     * set array indexes corresponding to them.
     *
     */
    //    $assign_to_config['template_group'] = '';
    //    $assign_to_config['template'] = '';
    //    $assign_to_config['site_index'] = '';
    //    $assign_to_config['site_404'] = '';
    //  $assign_to_config['global_vars'] = array(); // This array must be associative
    
    /**
     * If you are running the Multiple Site Manager, uncomment and assign the following variables 
     * See <a href="http://expressionengine.com/public_beta/docs/cp/sites/domainsetup.html">http://expressionengine.com/public_beta/docs/cp/sites/domainsetup.html</a>
     */
    //    $assign_to_config['site_name'] = '';
    //    $assign_to_config['cp_url'] = '';
    //    $assign_to_config['site_url'] = '';

    Cheers

    Greg

  • #3 / Sep 05, 2010 9:36pm

    bjyama

    38 posts

    Thanks Greg

    I was so focussed on the config file it never occurred to me to set it in the site index.php file despite going there to set the site_name during the MSM setup :(

    All is working… Thanks!

  • #4 / Sep 06, 2010 12:10am

    Sue Crocker

    26054 posts

    Glad Greg was able to help. Don’t hesitate to post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases