Jump to content

Change config params


regesh
 Share

Recommended Posts

Hi all.
I need to change $config->paths->data['templates'] value from "templates" to "m_templates" for example.

I think this wil be more easy to use specific folder for mobile view.

How to change depending on some actions? (detecting if site viewing on mobile browser)

Thanks

Link to comment
Share on other sites

Never done that (I usually use responsive CSS frameworks like UIkit to allow smooth scaling with a single set of templates), but you might have a look at @justb3a's MobileDetect module. With it, you should be able to adapt the paths (with code in site/init.php, not config.php, since the module needs to be initialized first) like in this recipe.

  • Like 1
Link to comment
Share on other sites

On 28.02.2017 at 5:02 PM, BitPoet said:

Never done that (I usually use responsive CSS frameworks like UIkit to allow smooth scaling with a single set of templates), but you might have a look at @justb3a's MobileDetect module. With it, you should be able to adapt the paths (with code in site/init.php, not config.php, since the module needs to be initialized first) like in this recipe.

Thanks for recipe. It works well but i can't get values before selecting template (

So if i put this code in init.php nothing works. I think it's because at this step there is no variable mobileDetect

if($config->mobileDetect->deviceType!='desktop'){	
    $config->urls->templates = $config->urls->site . 'm_templates/';
    $config->paths->templates = $config->paths->site . 'm_templates/';
}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...