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
0
votes
1answer
16 views

Is it possible to change admin Actions URL (not only the URI)

When Craft is in headlessMode my URLS for admin actions (ex. /admin/set-password) are set to the frontend URL (SITE_URL) instead of the Admin URL (SITE_ADMIN_URL). Is this behavior as expected? As ...
1
vote
1answer
11 views

Text cut off after migration in some fields

I migrated a site from Craft 2 to Craft 3 and on some Redactor fields, half the text is gone. It looks completely random. In some fields, the text is gone. In some the text is about half as long as ...
1
vote
0answers
8 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
21 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
39 views

How to filter the plugin store by price

We have a tight budget for a new Craft 3 site. How can the paid plugins be filtered from the store, so we can review only the free ones?
1
vote
1answer
25 views

Trouble updating Craft when allowAdminChanges is false

I've just updated a multi-environment site from Craft 3.3.5 to 3.4.5. Here's our config/general.php (irrelevant bits removed): return [ '*' => [ 'allowAdminChanges' => false, ...
1
vote
1answer
30 views

Sprout Forms - Notification Based on Checkbox Value

I'm using Sprout Forms 3.8.0.2 and Craft CMS 3.4.5. My client wants the email notification to go to different email addresses based on whether or not a form checkbox is checked. My plan is to create a ...
0
votes
0answers
12 views

Automatically replace strings in different language

We have sites for Germany and Switzerland that are pretty much identical but would like to cater to the spelling differences in Switzerland (namely replacing "ß" with "ss"). Is there any way to run ...
1
vote
1answer
8 views

Getting adjustment amount in a plugin

I need to get the amount of a discount from orders to write that data into a json file (on EVENT_AFTER_COMPLETE_ORDER) which then will be consumed by an inventory management system and now am stuck ...
0
votes
1answer
31 views

How do I change the /web directory?

I'm extremely new to Craft CMS - I'm trying to install it on to a Cpanel as a test, upon downloading the CMS is gives you all the folders for craft, and then a separate /web folder. If you move the ...
0
votes
0answers
17 views

Images won‘t display in an entry loop

Unfortunately I'm still very new to Craft, but I have a question to which I haven't found an answer here or in the Docs or the ones I found don't seem to work: Why doesn't this entry-loop output a ...
0
votes
0answers
24 views

Editing a users custom fields from a plugin action Craft 3

Does anyone know if there is a block on updating users form an action? Trying to update a users custom field in craft 3 via plugin in the admin. The admin template calls an ajax call to the action ...
1
vote
1answer
14 views

How to get the hash/anchor in the URL?

I am using an entry's slug as the anchor for a page. How do I grab the anchor from the request? For example I want to get #article-one from /blog/#article-one If it's not possible, is there a way ...
0
votes
0answers
24 views

Craft CLI not working

I am getting the following error when I try to execute ./craft help Exception 'yii\base\InvalidConfigException' with message 'Failed to instantiate component or class "modules\Module" How do I fix ...
1
vote
1answer
18 views

RegisterUrlRulesEvent rule to display site page

Within a plugin I have written I would like to route POST requests to the plugin controller and GET requests to a single entity created in craft. When the user POSTs to http://example.com/start-your-...
1
vote
1answer
42 views

Craft admin twig templates broken somehow

I am a front end designer building my site locally. This is the first time I've built in Craft and things have been coming along fine but now I'm getting the following error on every craft admin page ...
0
votes
0answers
15 views

Query Events by Matrix Field using Where clause

I am new to Craft CMS. I am able to get a list off all upcoming events with: $events = Calendar::getInstance()->events ->getEventQuery( [ 'calendar' => 'sample_calendar', ...
0
votes
0answers
30 views

Entry matrix field returns empty array

I have updated Craft from 3.3.15 to 3.4.2 version, and encountered the following problem. I have a form that creates entry which has matrix fields in it, entry is successfully saved in the database ...
0
votes
0answers
20 views

Feed Me - Not activating items added back in the feed

Feed me is set to disable missing elements, this bit works fine and disables all elements that are missing. The problem I am having is if one of these disabled items are added back into the XML feed ...
0
votes
0answers
13 views

Funky Shipping, Requiring Cart Updates

So we have a shipping logic on a site of (yes, that way round) < £5.00 => Shipping = £0.00 >= £5.00 => Shipping = £2.50 Currently, we have an issue where sometimes shipping is set to £5....
1
vote
1answer
31 views

How to process Matrix field in controller

I am trying to process a text field inside a Matrix field. In the controller I have this to get posted params: $element->setFieldValuesFromRequest($fieldsLocation); If I want to process a custom ...
0
votes
1answer
29 views

How does one get an order confirmation email to fire immediately in Commerce 3?

Curious if there is a way to fire order confirmation emails immediately? Basically how this was handled in Commerce 2. There are cases, and I'm dealing with one currently, where there is no command ...
2
votes
1answer
40 views

composer update missing zip extension (ext-zip) on MacOS

When doing a composer update in a Craft project on MacOS Catalina, I suddenly get the following error: ***** requires ext-zip * -> the requested PHP extension zip is missing from your system. Any ...
1
vote
1answer
40 views

{% Exit 404 %} doesn't work right with routes

The {% exit 404 %} doesn't work right on routed templates. It's fine on pages that aren't affected by routes. Mysite.com/asdfasdf shows me the proper 404 page. I've got some routes configured like ...
1
vote
2answers
26 views

Execution timeout problem when trying to add new field

I've been having some problems since I've updated yesterday to craftcms v3.4 (was 3.3). When I try to add a new field via the admin, it takes an enormous amount of time (almost 5min, had to raise the ...
0
votes
0answers
34 views

Excluding Section Entries from Search Query?

What is the best way to exclude a section (with date range criteria) from a search query? Currently, my past events are being presented in the site search - I'd prefer to remove them from the results. ...
1
vote
1answer
15 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
25 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
3answers
88 views

Programmatically add entries to an Entry field (craft\fields\Entries)

I work with Craft 3. I have an Entries field in a global set, I am able to get the global set, and then "read" this field programmatically (in a plugin) to fetch the entries that where added to it by ...
1
vote
1answer
21 views

Use GET parameters to query for array of entry IDs

On my client side, I have an array of entry IDs that match with entries in Craft const myIds = ['230', '249', '256'] I am trying to send that array over to an Element API endpoint and use it in the ...
0
votes
0answers
20 views

Craft search using criteria with related

In the element API following has been defined. $criteria = [ 'section' => $settings['section'], 'limit' => $settings['limit'], 'offset' => $settings['limit'] * ...
1
vote
1answer
34 views

Just upgraded to Craft 3, environmentVariables changed or stopped working

In my Craft 2 install, I had many links in Twig templates like this: <link rel="stylesheet" href="{{ craft.config.environmentVariables.baseUrl }}assets/css/styles.css"> I recently upgraded to ...
1
vote
1answer
40 views

Is there any alternative for the Redactor plugin in Craft 3?

The Redactor plugin not working well for me. So I am in need of another good plugin for an editor that supports HTML, image, video, etc. Please advise me about this.
1
vote
1answer
24 views

What will happen if we change the field type in the fields (settings -> fields) in Craft 3?

I am a beginner in Craft CMS. I just want to know, what will happen if we change the field type in the fields (settings -> fields) in Craft 3?
1
vote
2answers
22 views

How to reference a user related to entry input in if statement

I am having trouble referencing a user in an if statement: {% set otherEntry = craft.entries().section('other').userFieldInOtherEntry("{externalVariable}").one() %} {% if currentUser is relatedTo(...
1
vote
2answers
36 views

Proper way to implement array of objects as Craft field

I'm using Craft CMS for the first time and have a question about the proper/best practice to store what would equate to an array of objects (or just a plain array) in Javascript or JSON. Say I'd like ...
0
votes
1answer
22 views

Database Exception: Column not found: 1054 Unknown column 'position' in 'order clause'

I deployed the project from the git repository on hosting. When trying to open the homepage I get the following error: Database Exception SQLSTATE[42S22]: Column not found: 1054 Unknown column '...
1
vote
2answers
20 views

Redactor image button not showing up

I have seen a few questions the same as this, but none with answers that work. I am trying to use redactor to allow for dynamic blog posts to be written by my team. In my redactor set up file I have: ...
0
votes
0answers
10 views

Edit Order data after transaction capture

I am trying to create a plugin for Craft Commerce that manipulates order data after a payment has been captured. I'm trying to hook into the "After Capture Transaction" event like this: Event::on( ...
1
vote
1answer
23 views

Entry Search Unbearably Slow

Anyone have any tips on speeding up entry searches? Ours are currently taking about 90 seconds per search. Some stats about our Craft database: Entries: 336,000 Relations: 4,390,000 (!!!) Search ...
0
votes
0answers
28 views

How to handle two Redactor fields in one entry page in Craft 3.3?

I have an entry for blogs page. It contains 2 Redactor fields named content and body. I upgraded Craft 2 to Craft 3.3. Then the old editor changed to Redactor plugin, but that Redactor worked for body ...
1
vote
1answer
26 views

Commerce 2 Sales Not Present In Cart lineItems

I have an issue where sales and sale pricing seem not to be present in the cart. This is on an ecommerce flow where this was previously all working but I had moved onto other dev work on this site for ...
1
vote
1answer
18 views

How to reference specific asset subfolders in Craft 3

I am having trouble referencing specific subfolders in Assets in Craft 3 using Twig. The query that I've written is still showing all content, when I only want it to show content from a specific ...
0
votes
0answers
14 views

Block headerContent not rendering my HeaderBuilder?

I am using NEO plugin to structure my website. Currently I have create _layouts/base.twig file as my main file. Under that I am calling {% block headerContent %} {% endblock %} {% block ...
1
vote
1answer
40 views

Get address data of Order

This used to work in commerce 1: {{ order.billingAddress.firstName }} within a for loop of craft.orders.all(). No longer in Commerce 2. If I use this syntax I get Impossible to access an ...
0
votes
0answers
17 views

Error running garbage collection

When I run "./craft gc" or "./craft gc --delete-all-trashed=1" I get the following error: Running garbage collection ... Exception 'yii\base\InvalidConfigException' with message 'Invalid section ID: ...
2
votes
1answer
46 views

How can I write a PHP script to zip and download an Assets subfolder?

I've searched everywhere but can't seem to get a straight answer. I want to write a php script to zip and download an entire subfolder in my assets directory. The subfolders are named based on a ...
1
vote
0answers
31 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
12 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. ...
1
vote
1answer
12 views

How can I get field's value of entry in other site locale in my element-api endpoint?

I'd like to get a field value in 3 differents locales in the same element-api endpoint but I can't make a request similar to this one : craft.entries.siteId($siteId).id($entryId).one() in twig. <?...

1 2 3 4 5 28