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
0answers
7 views

Order entries by multiple matrix date field

I have a section with trainings. In each training entry there's a matrix field where we add a new block with a training date, location, etc. So each training has multiple matrix blocks. When I run an ...
0
votes
0answers
11 views

Address validation error on add to cart

When using EVENT_DEFINE_RULES in module adding items to cart fails as address validation is run. Should address validation only happen when address fields are present in the post data to 'commerce/...
0
votes
0answers
14 views

How to override filename saved in Sprout Forms?

After a form is saved I need to concatenate together the {{proposalCompanyName}} handle with the {{proposalFileUpload}} handle so that the saved filename in the Assets folder is proposalCompanyName....
0
votes
1answer
25 views

Change matrixblock field value before save element

So i have a Matrix with one type of matrixblocks. These all have a field for a custom id which should be set by the system, if empty, before the entry is saved. I can access the individual ...
1
vote
2answers
36 views

Add product to cart using code in Craft Commerce plugin

I want to add a specific product to a cart using its ID. I have created a module which runs on Order::EVENT_BEFORE_ADD_LINE_ITEM event. Here I am able to capture the current cart using the below code $...
0
votes
0answers
14 views

Craft 3 Hosting on Azure

I'm a newbie with Craft. I want to host Craft 3 application (with TWIG templates) on Azure app services. I couldn't find documentation of Craft's documentation. Any help will be appreciated. Thanks in ...
0
votes
0answers
19 views

Path to asset file shows “Template not found!”

I have a headless Craft CMS site and now the frontend development should start. I have absolutely no frontend or templates as I only worked on the backend. The asset url got created at /images. If for ...
1
vote
2answers
17 views

How to query EntryQuery for multiple sections with varying types

I think the best way to pose this question is by giving an example: Given a variable $query of type craft\elements\db\EntryQuery, I'd like to get entries from 2 different sections: "people" ...
0
votes
1answer
20 views

Changing Image transforms for different media queries

Is it possible to set different image transforms for different media queries? I have a grid layout containing 1 large image and four smaller images on large screens. I have created two image ...
0
votes
0answers
30 views

Getting access to file in headless cms + GraphQL error

I have a headless Craft site running in a vagrant machine. The site got published for the frontend development in React. My base asset url is xyz.com/images. When I want to open an image from the ...
1
vote
1answer
13 views

Get UI elements of entry in front end

Is is possible to get UI-elements of Craft 3.5 in the front end? Specifically wanting to get hold of the headers I use to separate fields of products. This is my current code: {% set layout = product....
0
votes
0answers
8 views

Adding a specific field to search() parameter that contains an object

I'm currently running a search which contains an object {query:query, subLeft: true, subRight: true} {% set query = craft.request.getParam('q') %} {% set entries = craft.entries.section('example')....
0
votes
0answers
36 views

Stuck upgrade from Craft 3.4

Getting a bit stuck on a site upgrade from 3.4 (3.4.29.1). After updating via composer getting DB errors. Initially: Integrity constraint violation: SQLSTATE[23000]: Integrity constraint violation: ...
0
votes
0answers
18 views

{% nav %} not properly working after {% children %}

The {% nav %} does not work for me as expected. After the last call of {% children %} but still inside the {% ifchildren %} the id of the last child element is used. Only after {% endifchildren %} ...
0
votes
0answers
9 views

Recognizing Twig tags in VS code live server

I'm not sure if this is the correct place to ask this, but seeing as I'm developing with Craft I thought I'd give it a try. Does anyone know if it's possible for the Live Server plugin for VS Code to ...
0
votes
0answers
10 views

Custom shipping methods in Commerce 2

I've been looking at the documentation for a long time now and can't figure out how to create several custom shipping methods in Commerce 2. Does anyone have any examples of how this can be achieved? ...
2
votes
1answer
17 views

Use own/custom field inside Craft Table

I made my own, fairly simple field inside a Module for Craft 3.x. What settings do i need to define to make it usable inside a table?
0
votes
0answers
17 views

Getting Events from Solspace Calendar using Element API

I am trying to pull the events from my calendar or calendars through the element api but I am running into an issue with the element type. I found an older post that gave examples but they no longer ...
1
vote
1answer
12 views

How to add custom options or fields to an Order Adjuster?

How do you add options or custom fields to an OrderAdjuster in Commerce 2? I'm migrating a website from Craft2 to Craft3 and need this, this is how I do it in Commerce 2: $promotionsAdjuster->...
0
votes
0answers
16 views

How to edit interactive “properties for sale” map

I'm trying to edit a section on the following webpage: https://edengardensepping.com.au/now-selling I am new to Craft and this has been a website handed to us to be updated after being built by ...
1
vote
1answer
17 views

Null Length Error on Craft Version 3

I am not super fluent in Twig and I inherited a website from a company that built the site in Craft v2. The site was upgraded to version 3 of Craft recently and one of the template pages is throwing ...
0
votes
0answers
39 views

Search results not showing all entries

I have a search results page that doesn't show all matching results. The result entries that do show appear to older entries that have smaller ID numbers, although I'm not sure if that has anything to ...
1
vote
1answer
32 views

Update entry title for all sites

I'm working on a Craft project that has 3 sites. The content for one section is pulled from an API using a console script which runs every 5 minutes. This has been working fine but I've discovered a ...
1
vote
2answers
42 views

Guest user registration using Commerce 3

I have just started using Craft Commerce (only Lite version currently) and I'm currently trying to get to grips with what is possible. My question is regarding subscriptions. The site that I'm working ...
0
votes
0answers
23 views

Website Stuck on Load after few requests

I'm facing a weird issue here. I'm developing a CraftCMS based website and all seem to be working fine, until after a few requests (clicking around 4 ~ 5 requests) the website seem to keep loading and ...
1
vote
2answers
15 views

Getting an zero index and count for an entry list

I currently have an entries field which outputs a list of related entries on page. I'm trying to find a way to display two values for these entries. The first would be a zero index. I'm trying to ...
1
vote
1answer
20 views

Search form - Passing only field params that are not empty or selected

Is it possible to have a search form pass (into the search query) the field params of only fields that have been populated/selected? For example, if the following form is submitted, both q and color ...
2
votes
1answer
17 views

Only allow SVG as file type

I want to have an asset field which only allows .svgs. To be more specific, I want to upload icons I can later import in my templates via the svg() command. Is this possible without any plugins or a ...
0
votes
0answers
25 views

Database error when setting up Craft CMS with Composer

I have come across a problem when trying to install Craft CMS using composer. I'm hoping someone maybe able to help me out. I'm trying to install Craft CMS using composer for the first time. In the ...
1
vote
1answer
25 views

Freeforms Check Submission is true

I'm trying to create a form that adds a cookie so that someone who has submitted the form can see content on the thank you page to protect the download. Currently I've got this: {{ craft.freeform.form(...
0
votes
1answer
26 views

Inconsistent search results in multi-site setup (prod/stage)

I have set up a staging site alongside production just like the docs describe (Craft Solo 3.4.24). I have copied the "Site Settings" for all sections and set the "Propagation Method&...
0
votes
1answer
20 views

Query only Tags wich are not connected to a revision

I wrote a query like this: $query = (new Query()) ->select('COUNT(elements.id) as count, tags.*') ->from('relations') ->join('INNER JOIN', 'tags', '{{relations}}....
1
vote
2answers
41 views

How to loop through multiple entries fields

I'm creating a dynamic side navigation where pages can choose which sidebar it wants to use. This is selected by an entries field called 'sidebar' - called in line 2. To create this I've made a ...
1
vote
1answer
50 views

Craft CMS Entries Disappearing

I've setup a Craft 3 site for a client and we are seeing the strangest thing where pages are just disappearing. Best we can tell no-one has deleted the entry, but we get a 404 on the front-end and it ...
0
votes
1answer
24 views

Rendering a template from a controller - unable to find template

Once again going out of my mind trying to figure something out... I have a custom controller which I want to return a rendered template. The template should, ideally, reside in my front end templates ...
1
vote
2answers
21 views

Sort Entries by Value from Dropdown

I have a list of students and can sort them by name, sport, and school. The name and sport portions are easy, I'm grabbing the values without issue. Where I'm struggling is the school value is from a ...
1
vote
1answer
12 views

Craft Commerce Product Options that increase price, but do NOT affect stock

My client wishes to sell artwork online. They're all one-off pieces and once one is sold, it should not be available to purchase thereafter. However, the artwork needs to have an option to be framed ...
0
votes
0answers
18 views

Updating Search Indexes failing because of “rouge” invalid field handle

I'm on the latest build 3.5.3. I created a Lightswitch field type within a Matrix field in my local dev env and called it "colorBlock". No problems there. When I recreated this in my staging ...
2
votes
1answer
23 views

Licence error and update issue cause of same plugin name / handle

We developed a plugin with the name "poll" (composer.json: webhub/poll) for one single project. Now we get the licence error in the control panel, cause there is a plugin to buy which has ...
1
vote
0answers
19 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
76 views

Why is $DEFAULT_SITE_URL appearing in entries URL?

I have an entry loop on my homepage that uses {{ entry.url }} that links to the full entry. When I click on the entry, the url looks like this mydomain.com/$DEFAULT_SITE_URL/the-entrys-slug Even ...
2
votes
1answer
110 views

Craft 3.5.1 CLI Update Error: Failed to instantiate component or class “yii\shell\Bootstrap”

when I try to update Craft via CLI to 3.5.1. I get the following error: Failed to instantiate component or class "yii\shell\Bootstrap in /vendor/yiisoft/yii2/di/Container.php:449 Stack trace: #0 ...
0
votes
0answers
27 views

How can I add data to a matrix field from a module without overwriting existing data?

I have an entry that has a matrix field. From a controller in a module I want to add additional data to it (e.g. some text that I have in a variable $messageText) but without overwriting the existing ...
2
votes
1answer
38 views

Help understanding hooks

I need to build a plugin or module that hooks into the Sprout form upload file function so I can add text programmatically to the user uploaded filename. I've had input before that I should work with ...
1
vote
2answers
24 views

Craft 2 to Craft update - timeout when updating database

I am trying to update a site from Craft 2 to Craft 3. I first set up a new server, installed Craft 3, copied over config settings from the original site, and moved over a copy the original database. I ...
1
vote
1answer
42 views

Random duplicate DB query issue

Can anyone shed any light on this duplicated db query issue? I've noticed when going through my site with the debug toolbar on, sometimes when I click a page or entry there is often double the amount ...
1
vote
1answer
31 views

Looping on the User Field added to Entry

I am fetching the fields of an entry in a block but can not draw through a user field named as eventHost. I get error 'Variable "name" does not exist.' What is wrong with my loop? {% set ...
3
votes
1answer
41 views

Custom CP Element Indexes

I'm working on a custom Craft 3 site, and I need to be able to configure the element indexes within the control panel for a few of my custom EntryTypes. There's two particular things I'd like to ...
0
votes
0answers
26 views

How how can I restrict/fail a login using a User::EVENT_BEFORE_AUTHENTICATE hook?

When a user attempts to login, I check a 3rd-party to make sure they should have access. If they shouldn't, I need to stop them logging in. I have this working, but I could only get it working by ...
2
votes
1answer
40 views

Cleanup Craft Logs

Whenever I have PHP problems I'm looking into the Craft CMS logs. However, at first I noticed there's a ton of stuff getting logged which is useless for me. Under this amount of logs, I can't find ...

1
2 3 4 5
31