Overwrite Settings through config.php or module
#1
Posted 23 January 2011 - 06:29 PM
Since the path to the directory is stored in the database it will not work locally and on the server with the same database.
Is there an easy way to overwrite settings through a module? What about making it so that config.php can store the path of the templates?
I think the best option would allow us through a module to extend or change any of the site settings. Im looking to change this: Cms_SettingsManager::get()->templates_dir_path.
Thanks for any help you might have.
#2
Posted 24 January 2011 - 04:38 PM
I'm sorry, but LemonStand is not intended for working in the shared database mode. The scenario you described is not typical, and most likely we will not make any changes in the core to allow it, at least in near future. LemonStand users usually develop websites in a development environment and then import CMS object to the live copy, and do the same operation for updating the live copy.
Thank you
#3
Posted 25 January 2011 - 07:03 AM
Although not typical, should I not be able to use a central database with two servers during development? Ive purchased a license and when deployed this site will work on one server.
At any rate, all I am asking for is a way for modules to overwrite some settings that store paths? Or the config.php to allow this?
Why do you not wish to allow this?
#4
Posted 25 January 2011 - 07:34 AM
config.php
$CONFIG['TEMPLATE_PATH'] = '/home/someuser/secure/templates';
cms_page.php
$settings_manager = Cms_SettingsManager::get();
$path = $settings_manager->templates_dir_path.'/pages';
$file_path = Phpr::$config->get('TEMPLATE_PATH', '');
if(!empty($file_path))
$path = $file_path;
Would this not be beneficial? The only problem I have is when you store paths in the database and not in a configuration file. In my opinion file based templates should use the resources directory unless you specify somewhere else in the config.php.
Why allow the user to manually input the directory? What happens if they change the directory does everything get copied over?
This post has been edited by activeholdingco: 25 January 2011 - 07:36 AM
#5
Posted 25 January 2011 - 09:07 AM
#6
Posted 25 January 2011 - 09:36 AM
This solved my problem. Never even thought to try relative directories because it says right above it the full path install of LS so I thought it needed the full path.
I would still like to vote for LS defaulting to resources/cms for the path and allowing developers to change this in config.php and not through the admin panel. I think this is more a developer oriented feature anyway and allowing the user to easily change this could become a problem down the road especially when moving servers (if the path is not relative).
Thanks though, I really appreciate it!
#7
Posted 15 April 2011 - 02:52 AM
#8
Posted 15 April 2011 - 05:34 PM
Fred Carlsen, on 15 April 2011 - 02:52 AM, said:
Thanks for the suggestion guys. We've added to our list. We'll let you know if/when it's published.
#9
Posted 20 July 2011 - 06:58 AM
Eric, on 15 April 2011 - 05:34 PM, said:
I know the original post for this thread was quite a while ago and you guys said you've added it to your list, but has this been looked at yet? I have searched and couldn't find anything in the docs.
The "Path to the templates directory" setting asks for an absolute path, I have tried using a relative path as a work-around and have come into random template rendering problems as a result.
I agree with the other posts, all environment-specific configuration options should be set (or overridden) in a file, especially paths, as is the case with other CMS/e-commerce software I use. I currently work on a copy of a website locally (with version tracking) but connect to the live database therefore it is not possible to use absolute paths if the setting is stored in the database. Having to maintain two separate copies of the database every time I need to work on the website will make it signicantly more difficult and time consuming.
#10
Posted 05 September 2011 - 04:04 PM
We just published an update which adds the {APP} specifier support to the templates path. It allows you to create templates paths relative to LemonStand installation directory. Updated documentation article: http://lemonstandapp...ased_templates/
Thank you
#11
Posted 06 September 2011 - 12:25 AM

Help














