Questions tagged [craft3]

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

334 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
0answers
307 views

How to load components into Craft 3 plugin?

what is the correct way to load third-party components into Craft 3 plugin I'm developing? I tried adding $this->setComponents([ 'authClientCollection' => [ 'class' => '\yii\...
4
votes
0answers
797 views

How to handle Craft 3 events in a plugin? Element API is returning null data

The below refers to Craft 3 and the Element API plugin for Craft 3. I would like to do something when the Element API plugin fires its onBeforeSendData event, I can see in the controller for element ...
3
votes
0answers
24 views

Freeform: Change field conditions between multi-page forms

I'm trying to only show some fields on Page 2, if a condition from a <select> box is met on Page 1. However, when I add Field Rules, I only have access to fields from the same page of the form. ...
3
votes
0answers
56 views

Craft Commerce: Create new shipping zone by excluding other zones

I need to create 3 shipping zones in Craft Commerce 2 (currently on v2.1.7): UK Europe Rest Of The World Having to manually add the countries to the UK and Europe zones isn't too much of an issue, ...
3
votes
0answers
197 views

Search weighting

Is there a way to control the weighting of certain fields in Craft when using search in the front-end? I have a Products Channel which I am trying to search against and I want to be able to boost ...
3
votes
0answers
429 views

Autocomplete for Visual Studio Code for plugin development

How to achieve autocompletion for Craft 3 for PHP inside Visual Studio Code? I mean, what is required (like installing PHP locally, folder structure etc.) if at all possible? I assume many people who ...
3
votes
0answers
340 views

Mailer config in Craft 3 not getting merged

I have this custom config in config/app.php, but Craft seems to keep using the default Control panel Sendmail config. It seems this doesn't get merged in the main.php file. (as promised) return [ '...
2
votes
0answers
82 views

How to Upload Multiple Assets Using Frontend Form

I'm trying to create a more interactive experience to upload moultiple images on a frontend entry form. Things I have done: I have implemented the code here: https://docs.craftcms.com/v3/dev/...
2
votes
0answers
29 views

Restricting entry editing in the admin section

We have custom permission setup where we have certain admins that are only allowed to edit specific entries. This is done by modifying the entries sources: Event::on( Entry::class, Element::...
2
votes
0answers
146 views

How to wire html template to twig extension? (Mainly `Twig\Error\SyntaxError: Unknown filter Error`)

I am going to use a Twig filter function by using Twig extension in my HTML file. I followed this guide. https://cameronspear.com/craft-cms-twig-filter-extension/ But when I run <p>{{ 123 | ...
2
votes
1answer
150 views

How can I debug `craft\web\User::_validateUserAgentAndIp()` warnings

On a production site, we're seeing a ton of the following warning in our web.log files for (seemingly) every request, creating a ton of noise in the logs and making it hard to spot "real" issues: &...
2
votes
0answers
94 views

Project config only partially syncing

Not sure if this belongs here but decided to post it after all... I've set up a craft site (Version 3.3.x) and since we're about to add more sites to it etc, we decided to start using a project ...
2
votes
0answers
125 views

What is the correct way to update a production site with composer?

I disable admin updates on production sites, and update Craft and its plugins by updating in the development environment, and then deploying to production using Git. My basic process starts like this:...
2
votes
0answers
289 views

How to download private assets (without public URL) from dashboard

I would like to download asset files from Craft 3 dashboard. Those files are out of web folder because of security reason. I made "documents" folder just under the root of the project, and the files ...
2
votes
0answers
158 views

Move an asset to another volume with volume specific OptimizedImages Field and on the entry a volume restricted Asset Field

I have three volumes: content, hero and overview. Each volume has his specific OptimizedImages Field(s). Asset Fields are restricted to its specific source volume. For example: A Super Table Field ...
2
votes
0answers
185 views

Diagnosing Slow Database Connection for Entries (Frontend and Craft Admin)

We have set up a remote database connection for Craft CMS so that I and my colleague can work on the same database locally. The connect seems very slow both front end and in the admin area. ...
2
votes
0answers
270 views

Group by Date Field in Element API Query

I have a custom field called releaseDate in one of my entry types. I would like to use Element API to get all the distinct years assigned to those entries. I dump all the years for all entries just ...
2
votes
0answers
227 views

Craft reCAPTCHA Plugin (Matt West)

Has anyone tried using the Craft reCAPTCHA plugin from Matt West? The issue I am experiencing is that if a Contact Form is submitted without ticking the reCAPTCHA widget, the form does not submit - ...
2
votes
0answers
456 views

Searching for Multiple Categories and Tags

I've been pulling my head for the past day on how to filter products with multiple categories. After a long search, I found and implemented on my project, Advanced Search with tags and categories It ...
2
votes
0answers
60 views

Add custom column to the orders list page

Does anybody know if it is possible to add a column to the orders list page? I can choose the 'Foo' label, but when the page want to show the orders list I get the following error: "{"error":"An ...
2
votes
0answers
67 views

Recommendations on integrating Craft 3 and FormAssembly

I was wondering if anyone could give me some advice. We have a client that we are in the process of moving away from a Drupal build to a new Craft build, however, they have a large number of forms ...
2
votes
0answers
109 views

Track downloads on assets

I need to figure out if there's a way to track the amount of times an asset was downloaded. I need to display this in the back end on the site. I don't need to display it anywhere but on the back end ...
2
votes
0answers
53 views

Creating an archive with linked asset

I'm trying to create an archive of PDF newsletters in Craft 3. I want to create a list of entries sorted by month and year. Then each year would appear separately. Finally, I want each asset within ...
2
votes
0answers
379 views

Craft Commerce 2: Adding subscriptions to cart

I am porting a Shopify "multi-site" to CraftCMS using Commerce and I need to be able to add subscriptions to the shopping cart (customers can subscribe to a monthly box), together with other products. ...
2
votes
0answers
553 views

Craft 3 Plugin - Only default action works

I'm working on a Cloudflare integration plugin for Craft 3. I set up the plugin with settings, which works fine so far. Now I intended to verify the Cloudflare credentials using an AJAX call. I set ...
2
votes
0answers
414 views

Can't find assets publicly via URL

Basically, I have an asset volume called Images, with base URL: /photos/ file system path: ~media/images Then I go to upload the asset and I try to view it, it gives me a 404 "Template not Found" ...
1
vote
1answer
23 views

Image Transforms not generated - permission problem?

Since I installed my Craft based website on the production server the image transforms are no longer generated. The tasks runs through more than 5000 images but doesn't generate new ones. There have ...
1
vote
0answers
20 views

Translation filter in Sprout Email plugin

I would like to make a notification of Sprout Email plugin bilingual. However, in the body field, the translation filter does not work. The tag of {{ fieldname.label|t }} is not translated. How is it ...
1
vote
1answer
25 views

How to auto enable a plugin after install?

I am developing a plugin for craft 3 and the plugin just got published to the store. I can browse through the store and install the plugin but it stays disabled. The user will have to goto Settings -&...
1
vote
1answer
35 views

How to define table attribute in the record file

Following code is working on Craft 2: class My_TableRecord extends BaseRecord { public function getTableName() { return 'my_table'; } protected function defineAttributes() { return [ ...
1
vote
1answer
31 views

Get entry by language in a module

I'm trying to get some auto translating done in a craft module. In order to do this I need to get the entry of another language in a save event. Is it possible to get this by language? Event::on( ...
1
vote
0answers
43 views

Test Craft Plugin without the use of a database

We'd like to add Unit Tests to our Craft Plugin. I have used the Plugin Factory generator to generate the files and the basic setup seems to work. I am however struggling getting the tests to work ...
1
vote
1answer
164 views

Checking which version of Craft CMS a site is using

I've been asked to look at Craft CMS site where my would-be client has been ghosted by his previous developer. I have no handover information and only FTP and phpmyadmin access presently. Looking ...
1
vote
1answer
28 views

Getting invalid verification code for email confirmation

I am using Craft CMS as a backend for react Next app. On our live site we are sometimes getting complaints from the user about error when user try to verify code sent in the email. This case doesn't ...
1
vote
0answers
110 views

Feed Me - feed format for importing into Super Table field

I am trying to import a list with the following format in each list item: <Date> - <Title> - <Icon> - <External Link> into a Super Table block containing fields for each of ...
1
vote
0answers
39 views

Assign user to group available even though not allowed? (Craft v3)

Working my way through the CMS to learn in more detail I'm currently at the users / permissions parts of the CMS. Here I just bumped into the following thing I don't understand: I have a Users Group ...
1
vote
1answer
93 views

Update Cart’s address ID from plugin

I want to try and stop Commerce 3 creating a new customer address if it’s a duplicate of an existing one. As an example, a store selling digital products has a checkout form that simply asks for the ...
1
vote
1answer
66 views

How many simultaneous visitors Craft CMS can handle?

I am looking for a CMS as a backbone for front-end work and I like CraftCMS by its interface and structure, so I wonder if CraftCMS is capable for this project. In practice, most of the work will be ...
1
vote
1answer
50 views

Adding 301 permanent redirections in Craft CMS

I am not able to redirect any dead page. Although I have added the redirection but it is not getting reflected. Please help.
1
vote
0answers
199 views

Check if entry type has field

I can't seem to figure out a good way to see if an Entry has an actual field defined. All the examples I see just to a falsy check for the property name, but this might fail if you have previously ...
1
vote
0answers
14 views

How to apply sales to custom order adjustment?

Is it possible to apply a discount voucher to custom order adjustments? EG i want 5% off everything. I have two order adjustments, one is rush delivery and the other is an engraving fee. At the ...
1
vote
0answers
41 views

How to save dynamically created checkbox values in plugin settings?

I am in the early stages of developing a plugin for Craft 3. In its settings it should have a checkbox for each section the user has defined that enables the admin to select or unselect each section ...
1
vote
1answer
130 views

PHP Core Warning – yii\base\ErrorException Module 'newrelic' already loaded craft 3

I upgraded Craft 2 to Craft 3.3. Sometimes I am getting an error in admin like below when saving entries or taking some URL. PHP Core Warning – yii\base\ErrorException Module 'newrelic' already ...
1
vote
1answer
54 views

Weird issue with craft/setup command

I have been trying to install Craft CMS on Windows. I tried composer: composer create-project craftcms/craft d:\temp\craft After that when I try to craft setup there is a loop on the console which ...
1
vote
0answers
396 views

Multiple Entry Types on GraphQL Fragment

So I am building out a Gatsby Site, which is using Craft in Headless mode as it's content source. In one Section, I have three entry types. Currently they have identical fields, but may diverge in the ...
1
vote
0answers
57 views

Prevent Redactor from stripping tags like <span>

Is there any possible way to prevent <span> tags from being stripped from a Redactor field? I've tried all I can using custom Redactor and HTMLPurifier configs to no avail. Basically what I'm ...
1
vote
0answers
29 views

Is any way to add translations for Braintree Gateway dropin interface?

The correct way to add translation to an instance of braintree.dropin is to add options.translations array when calling the braintree.dropin.create method, for example: if ($dropinUi.data('locale') =...
1
vote
0answers
38 views

Cannot get asset from custom user field, with no-admin account

I would like to get a file of custom user field, which is "asset", and provide a link to the file for the user. However, the asset file cannot be gotten. The length of the asset field is zero. In ...
1
vote
0answers
34 views

Craft Table/Tabular static entry input field

Is there a way to set up a Craft CMS entry field to have a table with predefined rows and columns? I have tried with the native Craft Table field, but it allows users to add rows or edit default ...
1
vote
0answers
87 views

Craft 3 memcached session storage in load balanced environment

I'm getting the good old session expired popup every minute in the admin panel which is odd given that memcached should be properly configured: php.ini session.auto_start = 0 session.save_handler=...

1
2 3 4 5
7