1

I created an environment variable (in config/general.php) called {baseAssetPath} which contains the server path to the folder where all my assets are stored. This makes it easier to populate the Path field in Assets settings.

However, this variable does not appear to work to configure the Upload Location when setting up an Assets field. Now, when I attempt to add an asset, or edit an existing entry, I get the following error.

Internal Server Error

Craft\EntryModel and its behaviors do not
have a method or closure named
"baseAssetPath".

Is Upload Location looking for a server path or a URL path?

If it's looking for a server path, why doesn't my {baseAssetPath} variable work here?

1

"Upload Location" doesn't reference you're environment variables. Instead, you've got a dropdown menu of your pre-defined Assets sources. Whichever one you choose will be used as the base of your file path.

Anything you put in curly braces after that will become a subfolder of that asset source. So your subfolder names will be created based on whichever Entry fields you define.

Upload Location

  • Ah, I see. I was confused by the placeholder text in that field, which is the same as the placeholder text in the server path field in Assets settings. That makes more sense now. – Philip Jones Jun 29 '15 at 20:30

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.