Hot answers tagged

3

Add this at the top of config/general.php file: use craft\elements\Entry; And change your loginPath value to: 'loginPath' => function() { return Entry::find()->section('login')->one()->url ?? null; },


3

The fix was to delete the content of the /cpresources folder and that did the trick.


2

As someone who theoretically might inherit your site one day... and also as future-you trying to diagnose a problem... please don't try to limit what Craft logs. If you want a quicker way to look for critical problems, check out the Yii2 Debug Toolbar as discussed here Profiling your Website with Craft CMS 3’s Debug Toolbar You can use it to very quickly and ...


2

The setting you're looking for is verificationCodeDuration which defaults to 24 hours (86400 seconds). https://docs.craftcms.com/api/v3/craft-config-generalconfig.html#verificationcodeduration (And see craft\helpers\ConfigHelper::durationInSeconds() for a list of supported value types)


2

You could achieve this using Aliases. In your .env, you could set DEFAULT_DOMAIN="yourdomain.com" then in your config/general.php you would do: 'aliases' => [ 'siteAbc' => 'http://abc.' . getenv('DEFAULT_DOMAIN'), 'siteXyz' => 'http://xyz.' . getenv('DEFAULT_DOMAIN') ], With this in place, you will be able to use @siteAbc and @...


2

When you enter live preview in the cp, it's an iframe to the URL you've set up for that section, including a token=xxxxxxxx, you need to pass this along to your GraphQL (assuming that's what you use), to let it know it's not supposed to fetch data from the database. Andrew Welch has a bit more info about it here: https://nystudio107.com/blog/headless-...


1

As far as I know, using the @web alias is discouraged if its determined automatically (which is the default behavior). If you override it with a hardcoded value in production I think you should be fine. Edit After checking the documentation, the warning is now pretty dissuasive against using the @web alias : When you actually use it in a site's base URL ...


1

SSL isn't currently available in Nitro–though it is on the roadmap for development. See github.com/craftcms/nitro/issues/10.


1

We were having the same issue. Our logs were getting so dense with SQL statements that it was hard to find our errors. And for the most part, seeing Craft's internal SQL would not help us debug the problem. What we've found is we can use the onelogger plugin. After installing it, we just needed to add a file called onelogger.php to our config file. This ...


1

Not currently, I'm afraid as that config setting is taken into account on a per-element (i.e. entry), basis. Feel free to make a feature request for it here, though: https://github.com/craftcms/cms/issues


1

I think you're getting a few conventions mixed up. Using an @ is typically reserved for aliases https://docs.craftcms.com/v3/config/environments.html#using-aliases-in-control-panel-settings What you're probably looking for is environment variables in your .env file. You could set: EMAIL_HOST=myhost EMAIL_PORT=myport EMAIL_USERNAME=myusername ...


1

In case someone is still having issues. setPasswordPath is actually expecting a template path and not a route. 'setPasswordPath' => 'myauth/set-password' I have a file that lives in here: MyCraftProjectFolder > templates > myauth > set-password.twig Some may get confused because of the name "Path" at the end of setPasswordPath as many other ...


1

Add 'autoLoginAfterAccountActivation' => true to config/general.php


1

Never too late to answer your own question. This is easily resolved now as Craft 3 stores user photos as assets, you just need to assign the CDN URL to the public URL field in Assets. https://docs.craftcms.com/v3/changes-in-craft-3.html#user-photos


Only top voted, non community-wiki answers of a minimum length are eligible