Questions tagged [config]

Craft configuration and settings.

Filter by
Sorted by
Tagged with
1
vote
2answers
26 views

@webroot - how to find out path?

Getting "Error clearing cache Control panel resources: Unable to clear control panel resources because the location isn't known for console commands" and the recommendation to set @webroot ...
1
vote
1answer
25 views

How do I renew Craft CMS license?

When I go to Updates in my home Dashboard, I see there are "5 updates available!" I click "Go to Updates" and a big orange ribbon pops up that reads: Your license has expired! ...
1
vote
2answers
26 views

Product Search - redactor description field not indexing

I am struggling to get my head around plurals and fuzzy search etc. I have seen this article, which seems to help answer this but am hoping someone can clarify based on my scenario Search forms ...
1
vote
1answer
48 views

Template URL/path alias

Is there any way to use an environment variable in the URL and template path settings for sections? We are prototyping a site with a temporary skin running alongside our front-end build but would ...
0
votes
1answer
14 views

Non-www connection refused issue

I have a strange issue on my installation. It works fine as www.domain.com but if I redirect to non-www in the .htaccess, it redirects but gives me 'Connection Refused'. the same happens if I go to ...
1
vote
0answers
38 views

Redirect to frontend login form after receiving email verification mail from CMS?

I'm working on a site with public registration and a manual approval flow for new users. The following settings for user accounts are active: Verify email addresses, Allow public registration, Suspend ...
0
votes
0answers
38 views

baseCpUrl doesn't seem to work as I'd expect

We have a couple of different repos doing various things all on the same URL. All of these have a web folder equivalent and want to be above the root. With that in mind, I've set up the following ...
2
votes
1answer
172 views

Invalid Configuration Error in Craft CMS 3 using Nitro 2

I'm getting into Nitro 2 and so far loving it. I decided to create a scaffolding project to jump start other projects. Along the way, I ran into this error: Invalid Configuration – yii\base\...
0
votes
0answers
16 views

Can control panel date display always be numeric?

I understand the display of entries' postDate, etc., in the control panel can be localized, but I'm wondering if it's possible to get rid of the "yesterday" and "today" designators,...
0
votes
0answers
73 views

Config baseUrl / assetBasePath

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 ...
0
votes
0answers
15 views

Different unix users for Craft config and Craft process

I want to configure Craft to run as user craftcms and have configuration owner craftowner. The purpose is to make configuration read-only to craftcms, so that there can be no changes to the ...
0
votes
0answers
25 views

Updating user email does not update username when useEmailAsUsername is set

When the config setting useEmailAsUsername is set, I would expect updating a users' email address to also update the username field when saving the element. However, this does not occur unless you ...
2
votes
1answer
253 views

Custom Aliases not working

I'm trying to setup aliases following the instructions in the docs, but I can't get them to work (for example they don't appear when setting paths for Assets). I copied and pasted the code exactly as ...
1
vote
2answers
28 views

Exporting site configurations for import to new websites - separate databases

Is it possible to export the site configurations of one website in terms of the site structures, not the content, for importing into another site with a separate database, essentially creating a site ...
2
votes
1answer
83 views

Use of App::env() compared to getenv() since Craft 3.4.18

I've noticed since Craft 3.4.18 there is a App::env() function from craft\helpers\App::env(). This was created from the discussion here it seems: https://github.com/craftcms/cms/pull/5893 It seems ...
1
vote
1answer
94 views

What are the yaml files in config/project? Should I commit them?

See the title. I'm currently committing the YAML files to our git repo so they deploy to our production server. Is that appropriate? Should I ignore the config/project folder?
1
vote
1answer
110 views

Incorrect canonical URLs and redirect chains

I have installed SEOMatic. However, I am getting incorrect canonical URLs. Here is an example: https://jenoffvanhulle.com/en/ The URL has a trailing slash, the canonical URL not A second problem is ...
1
vote
1answer
56 views

Updating plugin/module config via template/controller

I have a plugin/module that synchronises local records with a Google Sheet managed by the client. The URL for this doc is stored in a module config. I want the client to be able to update this via the ...
1
vote
1answer
69 views

German special characters like umlauts (ä, ö, ü) are not converted correctly with convertFilenamesToAscii

Filenames with German special characters are not converted correctly with convertFilenamesToAscii, e.g. ä, ö, ü are converted in a, o, u in contrast to ae, oe, ue in slugs with limitAutoSlugsToAscii.
1
vote
1answer
32 views

Loading assets cross-domain with SSL or non-SSL option

Here's a unique situation. I have three websites. All assets are stored at the domain of the first site: domain.com/files/* The first two sites run completely over SSL. No problem. The third site ...
1
vote
1answer
92 views

How can I set an alias dynamically based on request?

I have a multi-domain setup where I run multiple one-pager sites from different domains. For development purposes, I have configured it to work like this: dev has: http://localhost/www.domain1.com ...
2
votes
2answers
362 views

How to use SSL for local development with Nitro?

I've created a new Craft CMS project and installed Nitro to run everything in a VM. Now I'm wondering if it's possible to use SSL for the local domain? I didn't found anything in the documentation.
2
votes
2answers
228 views

Cleanup Craft Logs

Whenever I have PHP problems I'm looking into the Craft CMS logs. However, at first I noticed there's a ton of stuff getting logged which is useless for me. Under this amount of logs, I can't find ...
1
vote
1answer
39 views

Set duration of 'newpassword' link validity via config/general?

Is it possible to modify how long the 'newpassword' links are valid for via a setting in config/general.php? (I've found defaultTokenDuration but it sounds like this might only be for the live preview ...
1
vote
1answer
72 views

How can I configure multi-site base URLs where the subdomains are static but the domain name is dynamic?

For example, let's say I have two sites: abc.example.com and xyz.example.com but I want to also host test versions of those sites at example-test.com. It'd be nice if I could set the baseURLs to http:/...
0
votes
0answers
195 views

Multisite with unique domains not working with Forge config

I have a live install with a primary domain of https://marketing.vessul.co/ which works great. When I've added another site to this install and it's location is another folder such as /extra-site it ...
1
vote
1answer
36 views

Change maxRevisions setting per section

We'd like to keep the revisions feature active on our site, but a few of our content sections are synced with a third-party API and we don't need to keep a revision at all. Is there a way to set ...
2
votes
1answer
270 views

Error using environment variable for email setting

I'm trying to create an environment variable for email settings, but it doesn't work. Here is my email setting at config/general.php 'dev' => [ '@host' => 'host', '@port' => '587', ...
2
votes
1answer
88 views

Using element queries in general.php config file

Can i use element queries in general.php file? I wanted to set loginPath based on entry query, like this: 'loginPath' => Craft::$app->entries->section('login')->one()->url ?? false, ...
4
votes
1answer
856 views

How do you set up live preview for headless Craft CMS installs connected to Gatsby?

How do you set up live preview for headless Craft CMS installs connected to Gatsby?
1
vote
0answers
92 views

Craft 3 multisite: site specific config

I'm trying to do something like this in general.php config for a multi-site setup: // ... 'production' => array( 'myVariable' => array( 'site1Handle' => '111', '...
0
votes
0answers
28 views

Copy Live to a Test site on same domain?

I have copied my Craft 2.6 live site directory, and created a test directory on our webserver in an effort to create a test site. Also duplicated the db and changed the configure files to point to the ...
0
votes
0answers
1k views

Craft can’t connect to the database with the credentials in craft/config/db.php

I'm trying to upgrade from 2.7.10 to Craft 3. I follow the instructions/ docs to the letter, go to https://###.com/admin and am greeted with the above can't connect to database message. So far, I ...
1
vote
0answers
173 views

How do I get Craft custom settings from inside a module?

Additional settings added to config/general.php are placed in _customSettings private object. This means they cannot be retrieved using Craft::$app->config->general->someCustomSetting. How ...
2
votes
2answers
562 views

Deploying and syncing project.yaml

I have a Craft CMS site set up that deploys through TeamCity and am trying to set up a build step to auto run "./craft project-config/sync". I keep getting an error saying the file can't be found, I'...
1
vote
1answer
338 views

New Install, Permission Errors With /storage

I've configured Apache vHosts on a local box and installed a Craft 3 website onto it. This new instance will serve as my "staging" environment for an upcoming website. I've installed with composer ...
2
votes
2answers
414 views

Laravel Forge not honoring Craft 3 maxUploadFileSize config setting

I have a Craft 3 site deployed to a Digital Ocean droplet via Laravel Forge. I have the maxUploadFileSize set to 256B (268435456 in bytes) in my config/general.php like so: <?php return [ // ...
1
vote
1answer
397 views

Best practice for volume aliases in config files

I'm wondering about using a config/volumes.php file to specify volume aliases (instead of putting them in config/general.php). There's a comment in a previous codebase mentioning https://docs.craftcms....
1
vote
2answers
315 views

Turning off a site in multi-site/multi-environment config

Given a multi site setup (domain1.com, domain2.com) that also uses multiple environments (dev, staging, production) - how would one configure one of the sites to be turned off in the production ...
1
vote
1answer
23 views

What files do you have to be aware of when migrating (i.e config files)?

What files do you have to be aware of when migrating a craft application from one domain to another? Are the specific files one should be aware of?
6
votes
2answers
883 views

How do I prevent secrets beeing logged in the PHP error log?

Background: I'm running Craft Pro 3.1.19 on PHP 7.2.15 Craft CMS, by default, uses vlucas/phpdotenv to get the configuration (containing secrets / credentials and lots of other stuff) from .env ...
2
votes
1answer
222 views

Use alias for site url based on root url defined as env var?

I was wondering if the following setup is a good practice. In my .env file I defined a single rootUrl var which contains the site root url like this: ROOT_URL="https://www.mydomain.test" In the ...
1
vote
1answer
90 views

How to load entries data in the General Configuration file?

I'm trying to set dynamic paths for values such as activateAccountSuccessPath. This kind of code below from my routes.php file works very well: use craft\elements\Entry; $myAccount = Entry::find()-&...
1
vote
1answer
1k views

Invalid path alias

I'm not sure if I understand the alias concept entirely So I want to create an alias. I write a variable into my .env File: SITE_URL_DE="http://hello.local" Then I put it into my general.php File:...
1
vote
0answers
408 views

Strange Redactor Config error when importing colleague's database

Description I am getting this error after importing a database supplied from my colleague. I have deleted the vendors directory and composer lock file in an attempt to re-install Redactor. I have ...
1
vote
1answer
88 views

Allowing CRAFT_TEMPLATE_PATH in index.php from .env variable

It appears on Craft 3.1.8 that I can't set the CRAFT_TEMPLATE_PATH from .env without throwing a PHP notice error. This appears to be because the .env is loaded after the defines and I want to access ...
2
votes
0answers
231 views

baseUrl and trailing slash Craft 3

Despite setting baseUrl alias with trailing slash it appears it gets stripped off in Craft 3. CRAFTENV_BASE_URL="https://domain.test/" 'aliases' => [ '@siteUrl' => getenv('...
1
vote
2answers
690 views

Web folder content moved up a level - Craft Path settings

I use subdomains for staging environments. That meant in Craft 2 I had to move the public_html folder content up a level and change $craftPath = '../craft'; To: $craftPath = 'craft'; I'm getting ...
1
vote
0answers
390 views

HTML Purifier Allow <script

I understand the implications of having a script tag in my redactor field. But I am importing approx. 5k articles in to a Redactor field, some of which have various tags from embedded Podcasts, ...
1
vote
1answer
357 views

Routing: How can I ignore a parameter in route definition?

I'm trying to route users to a "locations" structure entry that normally has a URL structure that looks like: locations/<slug> My client wants to use the structure of links from their old site ...

1
2 3 4 5