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.

293 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
0 answers
438 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\...
Yuri Salimovskiy's user avatar
4 votes
0 answers
758 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/...
Adrian's user avatar
  • 437
4 votes
0 answers
1k 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 ...
David Beesley's user avatar
4 votes
0 answers
447 views

User Event before Login - check if user has password and logged in before

Is there a User Event before the authentication is fired? I want to show a message if the user doesn't have a password yet and if it's his first login / check if he never logged in before - All in ...
Christopher Dosin's user avatar
4 votes
0 answers
872 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 ...
Paul Blundell's user avatar
3 votes
0 answers
111 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. ...
OneMohrTime's user avatar
3 votes
0 answers
126 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, ...
Paul Goodfield's user avatar
3 votes
0 answers
331 views

Copy Content from original site to new site (multi-site)

I have an English site with content, but now I need to create another site in French. So I'm setting up a multisite for my Craft install. I want to copy over all my English content over to my new site ...
Holly Do's user avatar
3 votes
0 answers
661 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 ...
ScriptDev's user avatar
3 votes
0 answers
148 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 ...
Arkhiteks's user avatar
3 votes
1 answer
507 views

Displaying errors on frontend user forms

I'm trying to get some feedback for the user on registration when the username already exists but I don't know in which object the errors are. I use the form they provide in the docs: https://docs....
wietse's user avatar
  • 61
2 votes
0 answers
59 views

GraphQL next does not accept 'relatedToCategories'

I'm trying to get the next project in the "projects" section but with the same category. So because I can't do it in one query (the value of my category is in the result), I do another query ...
GaelP's user avatar
  • 21
2 votes
0 answers
39 views

Express Form: Get submitted data on success page

I have a very simple question. In Craft CMS, using Express Forms (free edition), I have a classic scenario. Page with the form, created by the form.openTag() method A success page which has '/success'...
user1447316's user avatar
2 votes
0 answers
153 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 ...
Jordi Kroon's user avatar
2 votes
0 answers
647 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 ...
zarun's user avatar
  • 131
2 votes
0 answers
113 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::...
Uros Jankovic's user avatar
2 votes
0 answers
306 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 | ...
apollo's user avatar
  • 63
2 votes
0 answers
260 views

change core element index pages

Is it possible to change core elements index pages -like entry index page- by plugin in PHP way, like extending their twig, using events, hooks and not manipulating DOM with Javascript? Currently ...
user9975's user avatar
  • 534
2 votes
0 answers
226 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 ...
mrsmn's user avatar
  • 731
2 votes
0 answers
200 views

Line item not found when trying to remove item from cart

I'm trying to remove a product from a cart but i'm getting an {error: "Line item not found"} error and I can't figure out why. Here is my code: $('.js-item').on('click', function(e) { e....
nmsdvid's user avatar
  • 305
2 votes
0 answers
718 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 ...
Kota.M's user avatar
  • 423
2 votes
0 answers
317 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 ...
wietse's user avatar
  • 61
2 votes
0 answers
424 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. ...
Dan Lee's user avatar
  • 1,107
2 votes
0 answers
451 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 ...
Tony DeStefano's user avatar
2 votes
0 answers
324 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 - ...
Roi Agneta's user avatar
  • 1,463
2 votes
0 answers
111 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 ...
Caroline van der Vegt's user avatar
2 votes
0 answers
237 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 ...
Kevin Love's user avatar
2 votes
0 answers
75 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 ...
glider's user avatar
  • 647
2 votes
0 answers
467 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. ...
Rosana Ruiz's user avatar
2 votes
0 answers
77 views

Multi-language, how Craft determines the CopyFrom after adding website and Section

The question is admin (backend only), not Twig : Where to Manage "copy from" site when adding new website and add section to this website. The "Copyfrom" takes place in the background after ...
eugbro's user avatar
  • 21
2 votes
0 answers
657 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 ...
Moritz Friedrich's user avatar
2 votes
0 answers
486 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" ...
user3928094's user avatar
1 vote
0 answers
41 views

Bulk Entries Migration works on local, but not updating elements in production

I'm trying to bulk update records based on a condition but the entries are NOT getting updated even though the migration seems to go through. Both code samples below work locally but NOT in production ...
cballenar's user avatar
  • 111
1 vote
1 answer
118 views

How to extend or override CP template?

I need to add some custom condition to the top siteMenu selector. Template file with top menu: vendor/craftcms/cms/src/templates/_elements/sitemenu.twig Block with this menu: vendor/craftcms/cms/...
DuxaBilii'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
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
1 vote
0 answers
91 views

Search query working locally, but not in production

I noticed that search (both on the public website and in the entries admin area) was not searching a given field. I checked the field and noticed that the "Use this field's values as search ...
vlasits's user avatar
  • 203
1 vote
0 answers
54 views

Editing entry without creating a new revision in particular scenario. is this possible?

I'm updating particular field in "A" section whenever a new entry is created in "B" section. In this scenario I don't want revision to be created for "A" section. Is this ...
Kishore Natarajan's user avatar
1 vote
0 answers
37 views

Dropdown field value printing cause additional DB queries in craft CMS 3.7

I am fetching an entry with drop-down values and When I print the entry the values are in the entry object. When I try to print the value like entry.dropdown.value it causes additional DB queries to ...
Parthiban's user avatar
1 vote
0 answers
318 views

Craft Commerce 3 guest checkout flow – can't update addresses

I'm finding a guest checkout flow in Commerce 3.4.14 insanely confusing, docs aren't much help. I'm using Craft Solo and Commerce Lite. TL;DR I realize the code below is probably too complex, so even ...
Yawner's user avatar
  • 65
1 vote
0 answers
58 views

Internal server error - Cannot serve directory

Randomly a couple of times a day my website throws an Internal Server Error that fixes itself within minutes. Checking the logs (have replaced my username with 'username') it looks like a server issue ...
otb's user avatar
  • 11
1 vote
0 answers
174 views

How to keep logged in User on 1 Craft Multi Site, but with different domains

I have one multisite craft installation, where the different languages for the sites use different domains: en -> domain.com de -> otherdomain.com .. Users can log in via frontend. Now if users ...
Henrik's user avatar
  • 425
1 vote
0 answers
120 views

Element API relatedTo not working

I'm creating a lazy load/infinite scroll based on the tutorial but I want it to grab entries that are in categories. It doesn't seem to be doing anything with it at all though. It's returning the list ...
Alyssa Tyler's user avatar
1 vote
0 answers
83 views

Help with understanding Controller routing

I'm building a module, and all is going well. I can access all "routes" except actionIndex. I have a controller named SendController.php And, I can access the method below using "...
Dario Zadro's user avatar
1 vote
0 answers
216 views

Craft CMS Freeform unable to override value of invisible/hidden field

In my control panel, I have a hidden field type with name 'Payment Amount' and handle name 'paymentAmount'. I am trying to modify its value to be the same as another field of the same form called '...
Steven Zhang's user avatar
1 vote
0 answers
97 views

Join multiple tables in element-api

My problem is the following: I have a website with products which contains ratings. I have an element-api endpoint to get the products. I want to sort the products based on the average rating or the ...
Mathies Gielen's user avatar
1 vote
0 answers
71 views

Non-admin users cannot preview/view entries when site front end is disabled (multisite)

I am running a multisite setup on 3.6.11.2. We are attempting to generate a new site and while we work on the structure/content I have the 'Enable on the front end' setting switched off. As an admin, ...
TheCodeNomad's user avatar
1 vote
0 answers
57 views

Craft 3 entry.author.getPhoto() is coming up null on template, but the author has a photo uploaded in the user > details section, any ideas why?

The site is utilizing a Servd bucket to store all assets. The backend shows a photo successfully uploaded to the user > details section, but does not provide a url in the entry.author.getPhoto(), ...
user11767's user avatar
1 vote
0 answers
62 views

Problems cloning an old production Craft CMS project

I'm attempting to clone a craft CMS (v3.3.15) project into a new local development environment and as expected, I'm experiencing many dependency issues. For various reasons, including having to ...
HDcadm's user avatar
  • 11
1 vote
0 answers
284 views

Craft warning: Tried to release a savepoint, but it does not exist

I'm working on a plug-in for Craft 3. For this plug-in is a migration is needed. When this migration runs and adds the entries, fields, and groups then the following warning occurs in the logs. [...
randomGuy's user avatar

1
2 3 4 5 6