Questions tagged [craftcms]

Craft CMS is a web content management system written in PHP and built on the Yii PHP framework.

Craft CMS

Craft CMS is a web content management system written in PHP and built on the Yii PHP framework. It is extendable with plugins.

Resources

243 questions
38
votes
3 answers

How to avoid issue related to Google Tag Manger in page speed to improve perfomance?

We have an official company website. When we check the page speed, the site is ranking low and showing Google Tag Manager script in "Reduce unused javascript". As google tag manager is important for the website, is there any way to solve this issue?…
Rakhi Vijayan
  • 593
  • 1
  • 7
  • 12
4
votes
2 answers

CraftCMS cookieValidationKey must be configured with a secret key

I am using CraftCMS, and I am getting this error: Invalid Configuration – yii\base\InvalidConfigException craft\web\Request::cookieValidationKey must be configured with a secret key. The longer error is: 1. in…
Devin Dixon
  • 11,553
  • 24
  • 86
  • 167
4
votes
2 answers

Reduce size of a docker image

I'm trying to deploy Craft CMS to zeit/now using Docker. It works locally, but zeit has an image size limit of 100MB. My container is currently 176MB. It's a Docker image using alpine, nginx and php modules required by Craft, and using a multi stage…
eivindml
  • 2,197
  • 7
  • 36
  • 68
3
votes
2 answers

PHP - Guzzle\Http\Exception\CurlException - Craft CMS

I'm running into an error with CURL on our staging server when trying to connect to the EventBrite API, despite local and production servers connecting just fine: [curl] 6: Could not resolve host: www.eventbriteapi.com; Name or service not known…
Bowen Fan
  • 31
  • 2
2
votes
0 answers

Craft CMS category count by slug

I created categories in craft and I'd like to get total amount of entries related to individual category. Right now I have a query that returns my categories: query categoriesQuery { categories(group: "projectCategories") { id slug …
2
votes
2 answers

How to create a dropdown in Twig using the syntax in the manual?

I'm trying to follow the syntax in the docs: https://github.com/craftcms/contact-form/blob/v2/README.md to output a select. I tried all sorts of syntax but I couldn't get it right… From the docs, I would have thought this would work, but it just…
Yann
  • 604
  • 2
  • 7
  • 16
2
votes
1 answer

How to allow curly braces in href attributes inside content that is processed with HTML Purifier

I have a redactor type field in my CMS (I use Craft CMS), where the user can enter some "variables" like so: "Hello, {name}" The only problem is that, when HTML purifier is enabled, it strips all such "variables" that are in href attributes and…
psithu
  • 21
  • 1
2
votes
0 answers

How do I access the matrix fields of an entry inside Plugin?

My goal is to calculate some computed fields when I save an entry, based on the current data. Some of the data is inside a matrix field Payments that contains multiple Payment records inside it. I made the Plugin listen to the BEFORE_SAVE_EVENT…
2
votes
1 answer

Error when opening preview in Craft CMS 3

I'm very new to Craft. In my tutorial of craftquest i am trying to open the preview of an entry but im receiving an error. HTTP 404 – Not Found – yii\web\NotFoundHttpException Template not found:…
Ruud van de Ven
  • 206
  • 2
  • 12
2
votes
1 answer

Ajax request is returning code instead of rendered html

I'm building a site in CraftCMS, but I think my issue is more specific to Ajax/Javascript than to Craft. I have some checkboxes, and when clicked, I'm trying to use Ajax to pass the checkbox value as a query string to a separate page and append the…
Jake1293
  • 61
  • 5
2
votes
2 answers

How can I search for the search query value from multiple specified fields in Craft CMS?

In Craft CMS I want to search for the search query value for only some fields/ multiple fields - but not all. For example limiting to the fields title, introduction, cardContent. I've added a search: property to to my queryEntry object with the…
DumbDevGirl42069
  • 891
  • 5
  • 18
  • 47
2
votes
1 answer

CraftCMS Gatsby project throwing error "GraphQL Error Expected type [String], found {eq: $slug}."

I just started working with Gatsby to see if it would be a good choice to rebuild my company's CraftCMS website with Craft as the backend and Gatsby as the frontend. So far everything has been working well until it came time to query for the…
SydneyH
  • 31
  • 3
2
votes
1 answer

How to fix 'CloudSQL connection failed: context deadline exceeded' in Docker Craft Cloud Run deployment

Recently when attempting to upgrade php versions of the docker file that runs craft cms in a cloud run service, I started getting CloudSQL connection errors. Example of logs. 2019-08-08T06:58:25.612096Z POST200 474 B 38 ms Chrome 75…
2
votes
1 answer

Docker container tries to mount a directory that is a file

I am building craft cms in docker and I am getting the following error, when I execute docker-compose up: ERROR: for craftcms Cannot start service craftcms: OCI runtime create failed: container_linux.go:344: starting container process caused …
dimitrisd
  • 566
  • 1
  • 9
  • 30
2
votes
0 answers

Saving asset field on a Craft front end upload

I have made a front end form for Craft CMS 3, using the Guest Entries plugin, to allow visitors to submit images (and some additional info) to the website. Works fine, also for multiple files. I now want to also save some fields to the uploaded…
Thomas L.G
  • 81
  • 5
1
2 3
16 17