Questions tagged [craft3]

For use with questions relating to the Craft 3 version of Craft CMS, including the Beta and RC releases.

Filter by
Sorted by
Tagged with
1 vote
0 answers
7 views

Object of class craft\commerce\models\ShippingMethod could not be converted to int Error generating from craft commerce

At a little bit of a loss here, just updated a Craft 3 site and I've started getting an error thrown whenever the cart is accessed. Relevant updates were: CraftCMS 3.7.11 -> 3.7.27.2 Craft ...
0 votes
0 answers
16 views

What happened to preferredLocale in craft3

I upgraded to craft 3 from craft 2. My users don't have access to the control panel so I created a plugin where they can select from the front end their preferredLocale to determine which language to ...
0 votes
0 answers
17 views

Issue with custom field plugin - conversion from Craft 2 to 3

I have a custom field I created for Craft 2. It is a usergroup field where it will show a variety of checkboxes where an entry can be apart of multiple usergroups. The plugin has worked fine in ...
1 vote
1 answer
27 views

With GraphQL why am I getting the error "Cannot query field \"save_personEvents_default_Entry\" on type \"Mutation\". "?

In Craft 3 I am trying to use GraphQL to mutate an existing entry in the section PersonEvents. Here is what I have in PHP $mutation = <<<QUERY mutation saveEntry(\$id: ID, \$avatarUrls: ...
0 votes
0 answers
36 views

How make custom order fields required with "event_define_rules" like a required address fields?

I want to make a craft commerce custom order field required (server side). I already use this for require the default address fields. But how to add custom fields? Because this is done on the Address ...
0 votes
1 answer
21 views

How to get event target asset in PHP module

I have been implementing my PHP module for Craft website. Could I ask how can I get the target asset in this if-statement? protected function initRestrictUserIndex() { Event::on( ElementQuery::...
  • 413
0 votes
1 answer
38 views

Optimise this repeated entry query? (which groups entries by a shared field value)

This loop containing a query is (surprise surprise) proving very intensive. There is also a second very similar query on the page to get all of the events related to this year and list them by just ...
1 vote
1 answer
27 views

Proper Localhost Setup in MacOS Catalina

I installed Craft CMS in /Volumes/Drive2/WWW/Craft using command line process and successfully done. But when sign-in in admin it will not proceed because it has error "Failed to load resource: ...
  • 11
1 vote
1 answer
18 views

Editing users preferredLocale from a plugin controller

Recently upgrade from Craft 2 to Craft 3. Also had to update all the custom plugins. Once of them is to run a daily import of users from a file. In that file we try to set the preferredLocal of that ...
2 votes
1 answer
54 views

Queued Job Failing

I have a rather large Craft CMS queued job that copies multiple entries which is repeatedly failing. The error I get is: The process "'/usr/local/bin/php' './craft' 'queue/exec' '621803' '300' '1'...
1 vote
2 answers
75 views

How to make comments on craft CMS?

Нow to create comments on this CMS? So far, I see only such a way - to create a separate section and write a module for adding entries to it. But something tells me that I will face a lot of problems ...
  • 253
1 vote
1 answer
36 views

How do I generate a slug based on another field?

Is it possible to somehow generate a SLUG not from the title field, but, for example, from your own created field? Example: A website for analyzing complex mathematical solutions. Each entry in the ...
  • 253
0 votes
1 answer
25 views

Deleting a matrix block type that was copied in code

I'm somewhat new to Craft, and struggling a bit with copying matrix block types. Any help would be greatly appreciated. So, I have some code that copies a matrix block and its fields, but when I go to ...
  • 21
1 vote
1 answer
25 views

How to set settings of plugin Redactor

I install plugin "Redactor"(version. 3.0.3) (https://github.com/craftcms/redactor/blob/v2/README.md). I use this type field for full text of article. I cant understand how to set the place ...
  • 253
2 votes
1 answer
17 views

How to display a category on the site?

Please help me to display the categories. I have a category group with a huge category tree. Can I somehow output not the whole group of categories, but only a certain category with its child ...
  • 253
2 votes
2 answers
56 views

How to make the number of article views?

Please tell me how to make the number of article views? Is there some free plugin or something else? Or does Craft CMS already have some kind of built-in tool for these purposes?
  • 253
0 votes
0 answers
78 views

Craft CMS + Docker Deployment Strategy

We are about to move to a new development and hosting environment (I am also new to Craft). Our planned development workflow is as follows: develop and test on a local craft cms docker container ...
1 vote
1 answer
52 views

(Feed Me) Request Method

I am trying to import data but the remote API only allows POST requests for this endpoint. I have looked into the docs as well as Guzzle but can’t seem to find info on how to change the request method ...
1 vote
1 answer
31 views

Updating Craft from Terminal

I have a Craft 3 docker container. Craft is on version 3.7.44. I log into the container with: docker exec -it [container id] /bin/sh In the container I run: php craft update Output: Fetching ...
2 votes
1 answer
39 views

How to organize a live search on a website?

I had a website on an old engine. And there I had a live search organized. Now I have decided to change the engine to CRAFT CMS and, accordingly, I need to organize a live search on the new engine. I'...
  • 253
1 vote
1 answer
32 views

Craft CMS Docker Environment Variables for SMTP

Where can I find the possible environment variables that the craftcms docker images accept? We want to be able to add our SMTP settings. In some examples I have seen the following SMTP related ...
1 vote
1 answer
27 views

Create a template for front end when plugin install

I have a plugin which embed a forum to front end website. For that i need a .twig template file to be created when craft admin install my plugin. The template file will have html code <div id="...
1 vote
1 answer
58 views

The size of the database has increased. How to reduce it?

I have a problem with the database. It weighs a whopping 450 megabytes. That's a lot. It increases by about 20 megabytes per night. I suspect that this has something to do with the CRON task: an http ...
  • 253
2 votes
1 answer
43 views

Craft CMS: update workflow

I have a local environment in developer mode, and I have a remote environment in production mode. I wish to install some Craft CMS updates. First question is, do the databases of both environments ...
1 vote
1 answer
32 views

How to convert slug to Latin?

Tell me please. I am adding an entry with a Russian title to the section. Slug is also obtained in Russian. How can this be fixed? I want to add an entry with the title "Привет мир", slug ...
  • 253
1 vote
1 answer
28 views

How to create a structured catalog?

help me figure it out. I need to create a structured directory. So that there are categories nested inside each other. I created the "Examples" section. According to the idea, there should ...
  • 253
0 votes
0 answers
36 views

ElasticSearch plugin configuration for accents insensitive search

I'm new to Craft, so please bear with me! We have an instance of Craft 3 with the ElasticSearch plugin. Until now we used the config in the backend of Craft. I've found that indexing/searching for ...
1 vote
1 answer
128 views

Craft CMS ERR_ADDRESS_INVALID

I have a remote VM developer environment based on Ubuntu 22.04.1 LTS. I have a development directory where I have checked out a GIT repo for our Craft CMS project. In this folder is also a docker-...
1 vote
1 answer
23 views

How to filter a categories query

I have a categories group named "Title" in my backend. In that group I have 15 categories, but I want to display only 3 specific categories on the frontend. How can I filter my query and ...
0 votes
0 answers
27 views

How to append the category field data nested inside a section to an input tag?

while clicking the input tag it should display its related entries Based on the category field the data selected in the backend value should get appended to the input tag. When looping through the ...
0 votes
0 answers
22 views

Why are inline styles stripped from twig image code when rendered

I'm attempting to fix/correct an issue on a project while its developer is away getting married. I have limited detailed knowledge of this codebase. I also don't have a quick way of building js/style ...
1 vote
1 answer
64 views

How to create pager of elements

Who can tell me how to create a pager on craft CMS. How would I implement this: {% set games = craft.entries().section('games').limit(10).all() %} I was thinking of getting the page number from the ...
  • 253
1 vote
1 answer
30 views

How can I add a zip folder to an asset field in craft cms

I'm quite new to the cms and would like to know how to programmatically add a zip folder to an asset field in craft cms using a plugin. So like listening to ENTRY_AFTER_EVENT and processing a zip ...
1 vote
3 answers
100 views

How to make the directory filter work according to the OR principle?

I have a problem with filtering elements. I have a product catalog and have an item filter. The filter has a set of checkboxes. The number of products corresponding to the property is indicated in ...
  • 253
0 votes
1 answer
44 views

How do I filter items by price?

I have a catalog of games. Every game has its own price. The price is a numeric field. At the moment I'm building a game catalog filter, and now I'm stuck on implementing the ability to filter ...
  • 253
1 vote
1 answer
62 views

Webp not available in image transformations although set up

I have already done some research and have not found anything related to my specific problem. Quite some time ago I installed Imagick on my VPS and thus enabled the use of the Webp image format in the ...
  • 31
0 votes
0 answers
19 views

Issue upgrading Craft 2 to 3 - Getting body content

I'm trying to upgrade the Craft CMS 2 site to 3. Except for getting the body content, everything appears to be working properly. Dumping a matrix field returns int 0, even though this field is loaded ...
2 votes
2 answers
61 views

How do I get the number of entries that have checkboxes?

I'm trying to get the number of entries that have selected checkboxes. This works successfully (where genreGames is a checkbox field): {{ games.genreGames('action').all()|length }} Is there a way ...
  • 253
0 votes
0 answers
20 views

AWS Load Balancer - Assets Uploads

We have two ec2 instances and a private IP db instance along with a Amazon Load Balancer. Is there a way to upload images on CraftCMS domain pointing to a load balancer? Right now the assets image ...
  • 1
1 vote
1 answer
42 views

How to programmatically create category groups and categories in Craft 3/4

I am struggling to create a new category group and category programmatically. I've found a few examples for creating an entry, and one for creating categories in Craft 2, but I can't get it working in ...
  • 417
1 vote
1 answer
22 views

How do I get a list of checkboxes for the item addition form?

I know how to get a list of selected checkboxes for a entry: {% for option in entry.myFieldHandle.options %} Label: {{ option.label }} Value: {{ option }} or {{ option.value }} {% endfor %} But I ...
  • 253
1 vote
1 answer
69 views

yii\base\UnknownPropertyException: Setting unknown property: craft\records\Element::canonicalId

I updated Craft and plugins to the latest version, and now I cannot save any entries, it throws the following error about unknown property canonicalId: 2022-11-10 15:15:45 [-][1][...
0 votes
0 answers
42 views

yii\base\InvalidConfigException: Invalid product ID: xyz

How can we fix this error please, full error below. yii\base\InvalidConfigException: Invalid product ID: 800296 The product exists, I can go to its edit page in the admin, but it wont save, this ...
1 vote
1 answer
81 views

How to create a filter of products?

Do you guys have a simple example of how to make a filter of products on the site? In the Twig template, I output a list of products like this: {% set products = craft.entries().section('products')....
  • 253
0 votes
0 answers
14 views

Which event to use in the FeedMe plug-in after a element match is found?

A client site has this plug-in installed and is now sending duplicated data to the site. We were initially advised the data they wanted imported to the site had unique titles and slugs - so those are ...
  • 127
1 vote
1 answer
40 views

Set preferred language for new users in CP in craft 3

i have a customer, who is admin and creates new users in the backend, so they can have access in the frontend. (with this login they see more content, than non-logged in users). After that, these new ...
  • 339
0 votes
1 answer
30 views

If is not triggered by a cron http request. Why?

Please help me solve the problem. Task: to organize the unloading of reviews from a third-party service that gives reviews in the form of xml. I solved this problem through the module. I did all the ...
  • 253
1 vote
1 answer
18 views

"addTrailingSlashesToUrls" Config option being ignored

I have set the addTrailingSlashesToUrls option in the config file config/general.php as below: <?php /** * General Configuration * * All of your system's general configuration settings go in ...
0 votes
1 answer
136 views

How to create a simple contact form?

please help me write a simple form for adding entries to the section. I have a twig template in which there is a simple form: <div> <form action="/add/contact/" method="...
  • 253
0 votes
1 answer
40 views

How do I save my entry with my publication date?

please help me figure out how to add my entry to the section with my publication date? Here is my code: $date = 1666064471; $entry = new Entry(); $entry->sectionId = 10; $entry->enabled = true; ...
  • 253

1
2 3 4 5
39