Skip to main content

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
2 votes
1 answer
198 views

How to use ajax call to retrieve data from craft cms entries to use in php application

I'm building a static webpage with php and Javascript. I have setup all my data in craft cms entries. I want to use ajax to retrieve the data from craft and just display it on my webpage. How do I do ...
Alyx's user avatar
  • 23
1 vote
1 answer
66 views

Deleting matrix block on front end form

The below code doesn't appear to be working for me, it will delete all other blocks apart from itself. I just need it to delete itself. trophyOrders is the Matrix field in the user account. {% set ...
Mark's user avatar
  • 741
1 vote
1 answer
83 views

Update user matrix field dropdown through module

Appreciate I may be asking for a lot here - I have an existing module that I use to fire events when a stripe order is completed. I would like to iterate through some User matrix blocks and update a ...
Mark's user avatar
  • 741
0 votes
0 answers
21 views

Survey Question - Not Seeing Success Message

I am creating a survey for a client but when testing the survey, I am having trouble getting the Success Message or Error Message when complete ("Thank you for taking the survey" or "...
adrienne's user avatar
1 vote
2 answers
52 views

Upgrading from Craft 3.7.1 to 3.7.19

I've been working through my long overdue updates. I'm now trying to go from 3.7.1 to 3.7.19 (note: I stop at increments that the CP Update list shows an "update warning triangle"). The ...
Unlimited's user avatar
2 votes
1 answer
174 views

Upgrading from 3.49 to Craft 4, Incrementally

We have a site that has been in production for a while and finally have been given the task of upgrading to Craft 4. We are at Craft Pro 3.4.29.1. Can I upgrade the site in stages? i.e. from 3.49 to ...
Unlimited's user avatar
1 vote
1 answer
33 views

Renaming an Asset in User Account on upload

I am using a miss match of what I have found across SE but I'm not really getting anywhere doing this form my module in Craft 3. What I would like to achieve: When a user uploads an asset to a custom ...
Mark's user avatar
  • 741
1 vote
1 answer
261 views

After upgrade from Craft 3 to 4: frontend error: Array to string conversion

After upgrading from Craft 3 to Craft 4, the backend is accessible but the frontend displays the error: PHP Warning – yii\base\ErrorException Array to string conversion And points to many files: ...
BrokenCode's user avatar
2 votes
1 answer
69 views

Registering an element source with EVENT_REGISTER_SOURCES for a specific site ID

Is it possible to register an element source for a specific site ID, while it not appearing in another? I have a module which is currently registering element sources, however we are now looking to ...
James White's user avatar
2 votes
1 answer
37 views

Access a CraftCMS 3 site that someone else built?

I'm trying to gain access to a Craft CMS site for a client that someone else built. We have access to the admin panel to edit content but I'm wondering how I would go about gaining access to the site ...
Michelle's user avatar
1 vote
1 answer
58 views

How to install Craft Commerce Shopping Feed Pro plugin

I'm attempting to install the Craft Commerce Shopping Feed Pro plugin using the following: composer require kerosin/craft-google-shopping-feed-pro But I'm getting the following error: Could not find a ...
MrCarrot's user avatar
  • 121
3 votes
1 answer
301 views

What does the triple operator ??? do in this case?

I know what the null coalescing operator (??) does. I have an example here with 3 operators and I am unsure what it does? Here is an example that I came across in a script I am trying to debug: {% set ...
BrokenCode's user avatar
1 vote
0 answers
24 views

Merging production version into local environment

My live Craft site was built by another dev a while back just before I joined the company, at the time of launching it I had it setup locally with docker and the most recent site files. Since it has ...
Sam St Aubyn's user avatar
1 vote
2 answers
110 views

Querying Globals from a Custom Field Type gives 502 Bad Gateaway

I'm creating a Custom Field Type whose possible values depend on the Globals. Therefore, I'm querying the Globals from the Custom Field's init(): class CustomField extends Checkboxes { public ...
Roman Sobkuliak's user avatar
0 votes
1 answer
272 views

Undefined array key "permissions" error after upgrade to Craft4

Hi need some help here. I recently I tried to upgrade Craftcms from Craft Pro 3.7.55.2 to Craft Pro 4.3.6.1, there is no error in migration, but when I try to edit a user group, I got this error: [web....
Thomas's user avatar
  • 69
1 vote
0 answers
47 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 ...
Josh Parylak's user avatar
2 votes
1 answer
3k 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: ...
Kirk Roberts's user avatar
0 votes
0 answers
115 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 ...
Maarten Heideman's user avatar
0 votes
1 answer
29 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::...
Kota.M's user avatar
  • 423
0 votes
1 answer
53 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 ...
James Greig's user avatar
1 vote
1 answer
46 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: ...
rawc's user avatar
  • 11
1 vote
1 answer
25 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 ...
user1535268's user avatar
2 votes
1 answer
474 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'...
Sean Girard's user avatar
1 vote
2 answers
231 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 ...
Dimi's user avatar
  • 325
1 vote
1 answer
339 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 ...
Dimi's user avatar
  • 325
0 votes
1 answer
51 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 ...
Eli's user avatar
  • 31
1 vote
1 answer
342 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 ...
Dimi's user avatar
  • 325
2 votes
1 answer
32 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 ...
Dimi's user avatar
  • 325
2 votes
2 answers
104 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?
Dimi's user avatar
  • 325
1 vote
1 answer
151 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 ...
Marcus Scheller's user avatar
1 vote
1 answer
296 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 ...
BrokenCode's user avatar
2 votes
1 answer
104 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'...
Dimi's user avatar
  • 325
1 vote
1 answer
107 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 ...
BrokenCode's user avatar
1 vote
1 answer
59 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="...
Kishan Mistry's user avatar
1 vote
1 answer
246 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 ...
Dimi's user avatar
  • 325
2 votes
1 answer
166 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 ...
BrokenCode's user avatar
1 vote
1 answer
49 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 ...
Dimi's user avatar
  • 325
1 vote
1 answer
55 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 ...
Dimi's user avatar
  • 325
1 vote
1 answer
184 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-...
BrokenCode's user avatar
1 vote
1 answer
243 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 ...
Ronny Peaky Scofield's user avatar
0 votes
0 answers
28 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 ...
Reeves Bale Ronny's user avatar
1 vote
1 answer
73 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 ...
Dimi's user avatar
  • 325
1 vote
1 answer
49 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 ...
Iron Brew's user avatar
1 vote
3 answers
118 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 ...
Dimi's user avatar
  • 325
0 votes
1 answer
89 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 ...
Dimi's user avatar
  • 325
1 vote
1 answer
251 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 ...
Dave's user avatar
  • 31
2 votes
2 answers
151 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 ...
Dimi's user avatar
  • 325
0 votes
0 answers
61 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 ...
Noor M's user avatar
  • 1
1 vote
1 answer
197 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 ...
Garrett's user avatar
  • 417
1 vote
1 answer
30 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 ...
Dimi's user avatar
  • 325

1
2
3 4 5
39