0

I've been away from using Craft (and web development in general) for a while now.

I'm having trouble getting the assets paths working for a site in my config, I gather things have changed since I last used Craft:

use craft\helpers\App;

$isDev = App::env('ENVIRONMENT') === 'dev';
$isProd = App::env('ENVIRONMENT') === 'production';

return [
// Default Week Start Day (0 = Sunday, 1 = Monday...)
'defaultWeekStartDay' => 1,

// Whether generated URLs should omit "index.php"
'omitScriptNameInUrls' => true,

// The URI segment that tells Craft to load the control panel
'cpTrigger' => App::env('CP_TRIGGER') ?: 'admin',

// The secure key Craft will use for hashing and encrypting data
'securityKey' => App::env('SECURITY_KEY'),

// Whether Dev Mode should be enabled (see https://craftcms.com/guides/what-dev-mode-does)
'devMode' => $isDev,

// Whether administrative changes should be allowed
'allowAdminChanges' => $isDev,

// Whether crawlers should be allowed to index pages and following links
'disallowRobots' => !$isProd,


'dev' => [
    // Base site URL
    'web' => 'http://url.test',
        'baseUrl' => 'http://url.test/',
        'assetsBaseUrl' => 'http://url.test/assets',
        'assetsBasePath' => '/Users/test/Documents/Google Drive/htdocs/test/web',
    
],

];

1
  • Are you getting an error message? What's the behavior you're seeing? The space in "Google Drive" is a red flag and might be an issue. Does it work if you escape it? i.e. Google\ Drive?
    – Brad Bell
    Feb 26 at 4:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.