Questions tagged [config]

Craft configuration and settings.

Filter by
Sorted by
Tagged with
19
votes
4answers
4k views

Can I run one Craft install on multiple domains and/or subdomains?

Is it possible to have one Craft install running multiple domains and/or subdomains? For example having the same Craft install running a blog Channel at blog.example.com and also an about Single at ...
15
votes
1answer
8k views

What's the recommended way to include vendor library dependencies in your plugins?

My plugin requires vendor library dependencies and api keys set. What is the recommended way to register an external library? I would also like to configure the public api keys separately for stage ...
13
votes
6answers
12k views

When uploading assets what determines the maximum file size?

When I upload an asset I get an alert window stating my file size is to large. I have increased the file size in the general.php config file larger than the file size, however I keep getting a error. ...
11
votes
3answers
2k views

How to set up {siteUrl} to work with both http and https

I'm looking for a way to set up the general.php file's siteUrl to be able to use both http and https. Only the front-end login would be using the https. This is how I currently have it set up: '...
11
votes
2answers
5k views

grab 'environmentVariables' with a tag

'dev' => array( 'siteUrl' => array( 'de_ch' => 'http://blabla.dev/', 'en' => 'http://blabla.dev/en/', ), 'environmentVariables' => array( ...
11
votes
2answers
656 views

Can I change the list of available locales?

Is it possible, by any method, to change the list of available locales? The current list includes some strange entries, e.g. East Germany, and we would like to update this to be more current for our ...
10
votes
1answer
2k views

Are there any intentions to release multisite support for Craft?

We're currently using a single ExpressionEngine install with MultiSite Manager to serve up 11 total sites that share the same database. After investigating Craft, and asking questions via Twitter it ...
9
votes
1answer
2k views

How do you set up Craft CMS to back up your site automatically?

I am considering having my site moved from WordPress to Craft CMS (feel free, by all means, to weigh in on this consideration), and wondered how one goes about setting up automatic backups within ...
9
votes
2answers
2k views

Craft, CSS Frameworks, Bower & Grunt setup suggestions

I would like to use a CSS Framework like Zurb Foundation with Craft. I also want to manage my bower dependencies and I want to use Grunt to concat and minify my sass/js as well as compress my images. ...
9
votes
2answers
800 views

How can I run the Control Panel from a separate domain?

Is it possible to separate the public site and the Control Panel on separate domains (i.e. www.domain.com and admin.domain.com)? With baseCpUrl you're able to force the admin URL to admin.domain.com, ...
9
votes
1answer
2k views

Load balancing nodes configuration (3 Craft nodes behind F5 Big-IP)

Craft deployed and working well on one node. Now looking into load balancing 3 nodes behind a LTM device (F5 Big-IP). The server environment is the following: a GlusterFS replicated "shared" file-...
8
votes
1answer
1k views

Query table in a different database

I'm writing another plugin for my craft app, this time I'm attempting to reuse a MySQL table that's used by other applications as well. I've a class extending the BaseRecord, and getTableName() will ...
7
votes
3answers
3k views

URL rewrite not working

For some reason the CraftCMS URL rewrite is not working on GoDaddy shared hosting server. Currently by .htaccess file looks like this Options +FollowSymLinks -Multiviews <IfModule mod_rewrite.c&...
7
votes
2answers
1k views

Is Redactor's default config saved as a .json file anywhere?

When I need to make one tiny change to the default config it would be handy to be able to duplicate the current default.json file and just change a one thing instead of building a duplicate from ...
7
votes
1answer
950 views

Do I need the web.config file in the craft root directory?

I'm working off of a linux machine (Apache) I don't use the web.config that's found in /public/web.config. I will use the .htaccess file. I am curious if I can remove the web.config file from /craft/ ...
7
votes
1answer
3k views

How can I set dynamic absolute Asset URLs?

I'm working on my first subfolder-based Craft site, so I'm relying on Asset URLs based on the {{ siteUrl }} variable. I cannot, however, manage to get them working. Any tags I add to the URL field in ...
6
votes
2answers
3k views

HTML Purifier Config File

I noticed the following new feature in Craft CMS 2.6.2973: Added the “HTML Purifier Config” setting to Rich Text fields. I can't see any mention or any example of config files in the Craft CMS docs ...
6
votes
1answer
952 views

Bootstrap Craft from another app

Is there any known way to bootstrap Craft to use the core functions inside another application? For example, in Magento anyone can include a file, initialize the app and use all the functions from ...
6
votes
1answer
4k views

Cannot connect to database with credentials provided in db.php

I'm trying to push a site live today and am running into a problem I'm having trouble solving. I have a staging site which is a subdomain on the live server and everything works fine there but when I ...
6
votes
2answers
518 views

New Relic and Craft?

I'd like to get Craft working with New Relic so I can play with my two favorite apps. My web host (EngineHosting) got the New Relic daemons et al going; has anyone tackled getting the Craft side ...
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 ...
6
votes
3answers
1k views

Multi-locale pages 404 on subdirectories

I'm developing and running a Craft site locally through Laravel Homestead and am having issues with pages 404'ing in a multi-locale setup. I've followed this guide closely: https://craftcms.com/docs/...
5
votes
2answers
1k views

`routes.php` config example

I want to move some permanent routes from the admin to my routes config file so that they can be version controlled. in the admin... news-sort/month/<year>/<month> .... news-sort/tag/<...
5
votes
1answer
2k views

Getting environmental variable via plugin

A similar question was answered before, but I was wonder how I might be able to return the same query from within a plugin (php)? Convert this: {{ craft.config.environmentVariables.baseUrl }} To ...
5
votes
3answers
1k views

Multi-environment configs and running sites on different ports

In my studio, we have successfully used multi-environment config files to allow several machines on our local network to use local MAMP installs as well as designate dev and production environments at ...
5
votes
1answer
2k views

My license.key file missing. How do I transfer the license to other servers?

I just purchased a license from the CP of my production server. Then I went to the config directory to retrieve the license.key for my local dev server but it was not there. I can't find it anywhere. ...
4
votes
2answers
1k views

How can I check from a plugin config file if devMode is enabled?

Using the Pixel & Tonic Contact Form plugin, I added a config file (config/contactform.php) to override plugin settings from the CP. I would like to change some settings if devMode is enabled : ...
4
votes
3answers
2k views

How can I use multi-environment configuration to set each root URL?

I'm building www.mynewcraftsite.com.au, but I also wanna create www.mynewcraftsite.dev which is a testing server to preview to my clients. I've heard that I can set this up with Craft without going ...
4
votes
2answers
2k views

How do i get variables from general.php

Within the config folder there is a general.php file with various vars which are site specific. how do i get at these from within a plugin? Thanks for your help.
4
votes
2answers
7k views

Craft 3: how can I set dynamic Base URL in sites setting?

Sites localized versions are setup using Base URL like this: — http://{baseUrl}/en/ — http://{baseUrl}/fr/ But {baseUrl} variables are not transformed using craft.app.sites.getAllSites(). {% set ...
4
votes
2answers
3k views

CSS is not loading on staging server

I'm quite new to server config, so this might be a simple mistake. I have a local environment setup on my computer that works just fine. I uploaded my project to my staging server at AWS and the only ...
4
votes
2answers
3k views

Upload file size limits to 256MB

I have run into a problem of file sizes maxing out on 256MB. On PHP side I have upload_max_filesize & post_max_size set to 1GB I've created a simple PHP script to test upload size and managed to ...
4
votes
2answers
2k views

General Settings > logo in the template

I have uploaded a logo in the General Settings, which I understand changes the logo on the login page. I was wondering if there was anyway to display this same logo in the site's template? I know I ...
4
votes
4answers
976 views

Is it possible to stop Craft from logging so much?

I've got a Craft CMS installation that is set to production mode. I notice that my logs get flooded with a bunch of entries which don't seem very useful. For example, in a matter of several days, I'...
4
votes
2answers
512 views

Can I set an environment var for SMTP mail servers?

Pretty straight forward here, I'd like to use MailTrap for devMode and then use an SMTP service (Mandrill or like) for production. I looked through the General Config Settings docs but didn't see ...
4
votes
3answers
2k views

Getting "Session Ended" popup in admin

Every minute or so I get the "Your session has ended" popup in the admin. Entering my password just pops the message back up. If I reload the page I'm still logged in. I'm running Craft in vagrant so ...
4
votes
1answer
844 views

How can I ensure using actionUrl in my template does not show script name in the generated URL?

I have an controller action in my custom plugin that processes Paypal IPN requests. How it works is that you provide a URL for Paypal to send it's notification requests to and then process them and ...
4
votes
1answer
519 views

Issues upgrading Craft 2 to 3 - Keep seeing Install Screen not Update screen

I'm trying to update my development site on MAMP from Craft 2 to 3. I've installed Composer and tried both upgrade methods (keeping the current directory structure & using the new structure). But ...
4
votes
1answer
726 views

Cannot remove index.php from URLs either

I am having the same issue as here: Another index.php?p= problem I tried to post this as a comment rather than open another post but I don't have enough reputation... I have tried all of the ...
4
votes
1answer
496 views

Set logging path/file to use php://stderr

I'm rethinking our Craft environment/workflow. My idea is to accommodate disposable and/or multiple container (or server) environments. As a result I want to use log aggregation apps like papertrail,...
4
votes
1answer
7k views

How do I properly set assets paths?

I'm having a problem getting my asset URLs to print properly in templates. The site is using a multi-environment configuration (dev/stage/live) with localized content (en/es/da) and shared assets. ...
4
votes
1answer
440 views

How can I disable sessions for most of my Craft site?

We're running a craftcms-backed site that uses sessions only for the admin pages. For a few reasons, we'd like to disable session logic for all other urls: the Set-Cookie header that craft uses to ...
4
votes
1answer
853 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?
3
votes
1answer
3k views

Custom template location

First Craft install so please excuse me if this is a newbie Q. Templates are in /craft/templates. Is it possible to move those to a different location? Our other sites (EE) have templates stored with ...
3
votes
2answers
207 views

Overriding isSystemOn setting for a single page

I have a staging site that has the isSystemOn set to false since I don't want people to stumble upon the site and be able to view content. I would like to have 1 page still "visible" though. This URL ...
3
votes
2answers
2k views

Direct access to controller

I'm trying to create a plugin with a controller, but I don't want to render any view but run a script from a cronjob. I can't get into the controller with an url and I'm not sure why. I already ...
3
votes
2answers
2k views

File robots.txt needed in Craft package?

I dont understand why we need the robots.txtfile in the Craft CMS package. I think it is confusing. (I had a problem with Google indexing one of my BETA hidden website because of that.) Reason : When ...
3
votes
1answer
675 views

Environment Variable siteURL ignored

In my general.php file I have a siteUrl environment variable declared: 'ontherocks.dev' => array( 'devMode' => true, 'environmentVariables' => array( 'siteUrl' => 'http://...
3
votes
3answers
2k views

Can't get Craft running on a remote server

I have a Craft site that works great locally, but I can't get it running on a staging server. The virtual host is working and when I remove code from index.php in html it runs perfectly. Here is the ...
3
votes
2answers
5k views

Passing JSON to Twig

I'm creating a multilingual site and I'm looking to pass some additional configuration data to Twig so I can use it in my template. For example, suppose I have a configuration like this: { "...

1
2 3 4 5