We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

EE6 Site System Preferences

How Do I?

Gilbert Lin's avatar
Gilbert Lin
4 posts
4 years ago
Gilbert Lin's avatar Gilbert Lin

Hello there, I see that the Site model no longer has site_system_preferences in the type columns. Is there a replacement for doing stuff like $site->site_system_preferences->base_url = 'https://new.site'; ?

Thanks!

       
Robin Sowell's avatar
Robin Sowell
13,160 posts
4 years ago
Robin Sowell's avatar Robin Sowell

It switched to a standard model, so try something like

$site = ee('Model')->get('Site', $site_id)->first();
$site->set(array('base_url' => 'https://new.site');
$site->save();
       
Gilbert Lin's avatar
Gilbert Lin
4 posts
4 years ago
Gilbert Lin's avatar Gilbert Lin

Hello Robin,

Thanks for replying! However the code snippet that you shared doesn’t work in our environment. The base_url is not hard coded in the config.php. I did have success setting the site_member_preferences like

$site->set(['avatar_path' => $value]);
       
Gilbert Lin's avatar
Gilbert Lin
4 posts
4 years ago
Gilbert Lin's avatar Gilbert Lin

Never mind. I found a way to do it using Configs and Config model. Thanks!

👍 1
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.