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
1answer
20 views

Redirect to Craft CMS Website Results in 403 "Request forbidden by administrative rules"

My Setup I added a stripe checkout redirect from my craft website using Stripe Checkout so I can accept payments from customers using payments handled by stripe. In simple, I use AJAX on the frontend ...
0
votes
0answers
14 views

HTTP 400 – Bad Request – yii\web\BadRequestHttpException

Hi I'm getting this error on every other save when in the page editor in Craft CMS: HTTP 404 – Not Found – yii\web\NotFoundHttpException Draft not found The only things I am certain of are: The error ...
0
votes
0answers
7 views

How to select entries based on site group?

I have multiple sites with multiple languages. In Craft 3, each language is a separate site, we can group them by site group. For example, In the USA site group, I have USA - English and USA - Chinese....
0
votes
0answers
18 views

Craft Commerce/Sprig - change add to cart button dependent on what is in cart

I am using Craft Commerce with Sprig and I am hoping to get some help with the add to cart button, which I need to change dynamically dependent on what is already in the cart. Essentially I have two ...
2
votes
2answers
164 views

Get array of titles instead of whole collection of entries' attributes

I know that to get the entries I can do: craft.entries.all() but instead of getting the whole collection of entries, I would like to get an array of titles from those entries (or any other field). ...
0
votes
0answers
8 views

How to apply discount after taxes in Craft Commerce

I have a unique situation where the discount applied must be done AFTER taxes are applied to the total cart price. Can I reorganize the discounts to come after tax? Or is there another way to make it ...
0
votes
0answers
13 views

How to display entry on home page from backend

I am using a version of 3.6 I want to display data on the homepage from the backend when I'm trying with {{ entry.displayName }} then getting an error Variable "entry" does not exist. how to ...
1
vote
1answer
23 views

Eager loading a photo within a matrix field

Thanks to some help recieved on another question I have discovered Eager loading which makes a lot of sense. I am now trying to output an image from a matrix field. I am part way there as my imageAlt ...
1
vote
1answer
25 views

Output post category

I have created a blog channel and a blog category along with a category field. Now I wish output the category within the blog post. {% set categoryEntry = craft.categories().group('blog') %} {% set ...
1
vote
1answer
20 views

Output Matrix field within Channel

Very new to craft and hence sorry if this is very basic. I have created a service channel which contains some matrix fields. One for a list and one for button. My approach here may be wrong and hence ...
0
votes
0answers
29 views

Craft CMS starts throwing HTTP status 500 after a few hours of uptime

I'm working on a "hello world" Craft CMS deployment to AWS ECS. To build my Craft CMS Docker images I use the official base image craftcms/nginx:8.0. The first few hours after the deployment,...
0
votes
0answers
31 views

How can we create the Martix type field?

In Plugin development, I have created a field, Is it possible to create a field as a matrix field or I will have to create custom add more functionality?
0
votes
0answers
27 views

SQLSTATE[HY000]: General error: 1525 Incorrect DATETIME value: ''

My website is running on Fortrabbit with the following settings: PHP version 7.4.15 OS version Linux 4.15.0-50-generic Database driver & version MySQL 8.0.23 Image driver & version Imagick ...
1
vote
1answer
26 views

How to display controller response on twig template?

In the plugin, I created a form and after the process, return the below response from the controller and redirect to the template. I am trying to print the response to the template but it's not ...
0
votes
0answers
18 views

CraftCMS + ReactJS (NextJS) send form

I build a website which has the frontend in NextJS and the backend is Craft. Everything works fine except for the emails. Does anyone have any experience on how I can send the submitted form to the ...
1
vote
2answers
48 views

Generating srcset in a similar way to WordPress

I come from a WordPress background, so I'm attempting to create responsive images the way I'm accustomed to with WordPress. Perhaps that's the wrong approach, I'm not sure. In WordPress I would ...
1
vote
1answer
14 views

Post Request Required Error Solspace Freeform

I installed Solspace Freeform onto a new site and am getting this error on form submission.
0
votes
0answers
36 views

Guzzle fatal error using Craft Guzzle client

Using the code below to get 3rd party API $uri = $baseUri . '/area/' . $areaId . '.geojson?api_key=' . $mapAPIkey; $client = Craft::createGuzzleClient(); $response= $client->request('...
0
votes
0answers
16 views

Error uploading to asset field from front end form

I'm getting an error when uploading to an asset field from a front end form during entry creation. SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type integer: "...
1
vote
2answers
92 views

Send automated emails to users that haven't logged in for X amount of time

What would be the preferred method to send an automated email to users that haven't logged in for a set amount of time? Let's say for a month. Are there any plugins that have this feature, or will it ...
0
votes
0answers
9 views

Running a a join query in a plugin with a background job API call

I'm working on a plugin and need some steering. I have two sets of entries that are linked by a foreign key value. (They are not related entries but lsoaname value corresponds to a field in 2nd set of ...
1
vote
1answer
12 views

Search query for assets

I build a search component, and it works fine. Now I would like to show all the uploaded assets from a specific page ("Downloads") in the search results that include the search key. How can ...
0
votes
0answers
36 views

Craft CMS site with 5 second server responses?

After recent changes on our Craft site and the DB, we are experiencing 5-second server response times. The server checks out and it looks like scripts or the DB itself causing this as a basic HTML ...
1
vote
1answer
30 views

Is there a way to query for structure Entries that have no Parent?

Suppose I have a structure Section with Entries like this: Parent A Child X Parent B Parent C Child Y How would I return this list of Entries? [Parent A, Parent B, Parent C]
0
votes
0answers
8 views

Category’s group (1) is not enabled for site (1). when moving site?

I've moved my site over, importing from the previous one using the project folder. When trying to do a feedme import I'm getting the following error with Categories: Category’s group (1) is not ...
1
vote
1answer
17 views

Can some one explain Event rules in plugins

So here is what I see in a controller: $event->rules['cpActionTrigger1'] = 'plugin/default/do-something'; What does the first part 'cpActionTrigger1' refer to and what does the second part refer ...
1
vote
1answer
14 views

Multiple login forms

I have a need for 2 different login forms: customers and professionals. Each login form is slightly different in markup and heading and has different linkages to the registrations form(s) if a visitor ...
1
vote
1answer
23 views

Filter a channel entry by dropdown value inside a matrix related filed

I have a channel called 'people' where a dropdown is used to say if they like 'cricket' or 'football' Inside a matrix related entry I am trying to show what they like from that dropdown field value ...
1
vote
2answers
51 views

Specific emails failing in queue

I have craft 3.7.11 with commerce 3.4.2 installed. The majority of site emails send correctly, but every few days, one order status change email fails. The prior emails for these orders send correctly,...
0
votes
1answer
22 views

How to alter CP entry edit form

On an entry edit form I'd like to alter the options in a multiselect field to be user relative. Is there something like a form_alter hook?
0
votes
0answers
38 views

Craft not using correct URL on Entries' list link button

I'm using Craft as a headless CMS and when I click on the entry link at the entries' list it uses the Craft Server URL instead of the correct frontend URL (See images). For example: https://craft-...
0
votes
0answers
17 views

Commerce Shipping/Tax Estimates

Within the checkout flow, I am looking to offer an up to date 'shipping/tax' estimation. Looking through the Craft Commerce docs, I found the 'Estimate Cart Addresses' (https://craftcms.com/docs/...
0
votes
0answers
13 views

Images get stuck as temporary when uploaded to an Asset Field in a Matrix Block where the storage path contains the block ID

I'm facing an issue, and possibly a bug or an un-fixable kind of logical issue, where I have a Matrix Block with an Assets Field inside of it. The storage path for the Assets field is pointing to a ...
0
votes
0answers
15 views

How to change site propagation for channels without duplicating all entries over all sites

We currently have setup a template and quite a few sites for the same template up and running using the multi site manager. For all sites the base entries are the same so we first used the setting on ...
1
vote
1answer
26 views

Matrix query fails when using multiple fields

I am on Craft3.5 and trying to build a matrix block query where I would like to return results from two different matrix blocks. The docs seem to suggest that this is possible. This is the code I ...
1
vote
1answer
14 views

How to convert currency is there any way or any plugin available?

I am working on E-commerce website and I am using craft commerce for that.Is there any way or any plugin available for that?
0
votes
1answer
15 views

How can I revert a migrations from the control panel?

Is it possible to revert a migrations from the control panel?
1
vote
1answer
20 views

I am working on a plugin and I have to use a method of one controller in another controller's method?

As I have a method name statistics() in my defaultController and I have to use the same method in viewController is there any way to do so?
1
vote
1answer
29 views

Commerce: Is there any way to give a discount for Product A if the costumer buy 3 Product B?

In Craft Commerce 3, there is a Order Condition Formula that allow us to condition for the discount. So here is my Case. I have product A and Product B, so I will give a discount to Product A if the ...
1
vote
1answer
50 views

How to add a class to an image figure in redactor?

Using Redactor Custom Styles plugin we're adding a button with options to toggle classes on figures. It mostly works except for images. Here's an entry in our redactor config. "customStyles":...
1
vote
1answer
20 views

What are the minimum permissions to show the Craft debug toolbar?

To help validate a process is in place, we would like to allow a tester to login and view the Craft debug toolbar to see the logs. Currently, we have given the tester Admin, but we would like to only ...
1
vote
1answer
21 views

Craft Plugin Implementation: How to get handle of Field in getInputHtml() function

How to get handle of Field in getInputHtml() function. This is my function: public function getInputHtml($value, ElementInterface $element = null): string { $name='test'; ...
1
vote
1answer
28 views

global variable {{ siteUrl }} in multilingual sites

In multilingual sites the global variable {{ siteUrl }} should not point to the URL with "/de/" if it is included in the templates head section for pointing to a global js-file or css-file (...
0
votes
0answers
38 views

Localization for "Home" site (eg https://example.com/de" results in 403 — Forbidden

I have set up a multilingual site in Craft CMS and the localization (via url-slug eg. .../de/...) works on all pages. However, on the home site (index.twig) this leads to an error message "403 - ...
0
votes
1answer
39 views

Regular Expression replace not working within Twig Template

I'm attempting to capture 4 attributes of an Attributes of an tag and injecting inline styles to the style attribute. Craft CMS and Twig templates are being used to generate HTML emails here, hence ...
1
vote
1answer
29 views

Can't register custom adjuster with Craft CMS commerce

following https://craftcms.com/docs/commerce/3.x/extend/adjusters.html#writing-an-adjuster I am trying to make a custom adjuster: I placed class myPlugin extends Plugin{ Event::on( ...
1
vote
0answers
30 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 ...
0
votes
0answers
18 views

Unable to save/edit system messages due to "a sever error occured"

I am trying to send the user activation email to registered users, however the email sent is blank and in the email settings of the backend I cannot edit or save the System Messages. On the backend it ...
0
votes
0answers
19 views

How can I add a new event from the front end to a solspace calendar event field added to the user profile

I am trying to add a new event from the front end to a solspace calendar event field I added to the user profile. I created a calendar event field then added it to the user profiles. I can add an ...

1
2 3 4 5
35