All Questions
14,269
questions
1
vote
3
answers
25
views
How can I order Site Groups?
I have this query that lists out the site groups:
craft.app.sites.getAllGroups()
How can I order the result? Ideally I'd like to add a custom field to the Site Groups entry, but it doesn't seem Craft ...
1
vote
1
answer
27
views
Plugin migration - how to handle count in php8.1
I am trying to migrate a plugin from Craft 3 to Craft4 .
The plugin basically checks the entry for a pdf asset and create a thumbnail asset from the PDF using Imagick to save with the entry.
I use to ...
1
vote
1
answer
47
views
Boolean false Feed Me data is not being processed
I have a feed that needs to map data to a lightswitch field. When the API returns data for that field that equates to boolean true, it works fine. But when the data equates to boolean false ("...
1
vote
1
answer
65
views
Craft 4 move entries
I have two sections with the same fields. I want to move entries from one section into the other section.
There is this post but its there a better way in Craft 4?
1
vote
2
answers
59
views
GraphQL queries for srcset
I am trying to fetch srcset with GraphQL from Craft4 but I don't really understand the syntax. In my twig Templates I use image.getSrcset(['1x','2x'],'myTransformHandle') and I'm trying to translate ...
0
votes
0
answers
24
views
Unable to list entries in site where section type is not available
I am using Craft CMS 4 latest. I have a NeoSections field that among others contain a field called entries that has one or more entries in it.
I am running a multisite with 8 sites in 4 site groups.
...
0
votes
0
answers
60
views
Commerce 3: How to programmatically create a custom field and assign it to a Product
With this kind of setup:
function random()
{
return array_reduce(range(0, 9), fn ($x) => $x . range('a', 'z')[rand(0, 25)], '');
}
$salt = random();
$result = Craft::$app->getFields()->...
0
votes
0
answers
26
views
Calendar Start Date must be before End Date
I have an event that's set for:
Start Time: 08/26/2023 10:00PM
End Time: 08/27/2023 2:00AM
This is for a front-end form creation for public use.
I'm getting this error "Start Date must be before ...
1
vote
2
answers
59
views
Redirect users with no CP permissions automatically
I have some user groups defined with their specific rules.
A normal user or visitor is of course not allowed to access the admin dashboard.
When I'm logged in as a user with no permissions to access ...
1
vote
1
answer
73
views
Where I can find visitor analytics for my website on the craft backend?
I would like to see visitor analytics for the website, specific pages, etc. but I don't see that information. Seems like it should be simple to find. Any suggestions? Thank you!
1
vote
1
answer
46
views
How to differentiate between draft versions in ModelEvent?
craftcms/cms : 3.6
First create new entry and it store as draft
then i publish this entry
then create a new draft version of this published entry
so how to differentiate this is first draft or second ...
2
votes
4
answers
46
views
Find all entries containing a certain twig component
How can I get all the pages (entry urls) which are containing a certain .twig component?
Ex:
$entries = Entry::find()->search('button.twig')->all();
$urls = [];
foreach ($entries as $entry) {
...
1
vote
1
answer
47
views
Syntax for URL route instead of using url parameter
I'm confused by the syntax for URL routes. Using Craft 3. I'm working with two separate category groups and have urls like this:
site.com/?parameter=123
site.com/abc?parameter=123
site.com/abc/xyz?...
3
votes
1
answer
31
views
In FeedMe transform one data element before it gets parsed
I've got a json data feed that has related entry titles in a pipe delimited format like so:
'Entry1 | Entry2 | Entry3'
I thought feedme actually used to be ok with that, but it looks like now it has ...
1
vote
2
answers
46
views
control panel: bidirectional related entries // concatenate entries
Is ist possible to "concatenate" entries?
For example:
You have five articles (A, B, C, D, E) ... might be a blog
Editing the article A: A is related to C and D
The relation should work ...
1
vote
1
answer
41
views
Redirect from /products/.* to /products not working
Currently we have a route called /products. On this route there is a SPA active which handles the routes after /products. To ensure that people don't get a 404 when directly typing in a route like /...
1
vote
2
answers
97
views
How to manually import entries into Craft CMS?
I have some entries saved in a JSON file with the standard format that is created with export functionality (expanded). How can I import the entries from this JSON file back to my CMS?
Feed Me seems ...
2
votes
1
answer
45
views
Save Control Panel search filters? Craft 4
I love the new control panel search filters. However, I see no facility to save them, and nothing in the documentation. Is there way to do this?
1
vote
1
answer
41
views
craft.matrixBlocks - related to entry
I've got classes by entry and each week is a matrix block inside that week. I'm then outputting all weeks together using this query
{% set startDate = date(now)|atom %}
{% set classes = craft....
1
vote
1
answer
50
views
Internal Server Error YAML Parse Exception
I'm getting a Craft-styled internal server error, and when I inspect the logs, it says
[error][Symfony\Component\Yaml\Exception\ParseException] Symfony\Component\Yaml\Exception\ParseException: You ...
0
votes
0
answers
31
views
Prioritising Paid Authors In Entry Queries - Craft 4
I have a Craft CMS 4 website with an entry query that's displaying results in order of priority (1, 2, 3 or 4) and sub priority (1, 2 or 3). I've assigned these numbers to the entries via entry fields....
1
vote
1
answer
36
views
Can not-related block types share a matrix field
I am aware that block types that are related should have a matrix shared. For example, to implement a slider, there should be image and caption block types inside a slider matrix.
But what about ...
1
vote
1
answer
26
views
Cookies Change-If we add(/?) with URL content changes are reflected
We have done content changes in site(www.windstream.com)after changing content in this site and we clear cookies as well. But still changes are not reflected. If we add(/?) with URL content changes ...
0
votes
0
answers
20
views
Empty config diffs
We're using Craft Pro 3.8.14 with allowAdminChanges=false for production environment. On each deploy, we do
./craft migrate/all --interactive=0
./craft project-config/apply
./craft clear-caches/all
...
1
vote
1
answer
52
views
Check if eager-loaded category exists on product
On my craft commerce project i eager-load categories which belong to a prodcut.
in my product template i do for eager -loading:
{% do craft.app.elements.eagerLoadElements(
className(product),
[...
1
vote
1
answer
230
views
How do I solve "Unknown Property – yii\base\UnknownPropertyException Setting unknown property: craft\fields\Assets::branchLimit"
First of all I am new in CraftCms.
I am trying to run the project local which I cloned, so I have a database which I must import to this project. now its giving this error when I finish importing the ...
0
votes
1
answer
33
views
Duplicate queries out of the box?
I'm trying to strip back duplicated queries on a site, but after removing as much as possible from the homepage so nothing is coming from the CMS I'm still getting 7 duplicate queries.
Is it possible ...
0
votes
1
answer
91
views
Sending emails with Craft 4 with custom Module
I'm currently working on a school project for my finals using craft cms.
One of the targets I have to achieve are simply sending emails when someone fills in his email in an input mail and submits ...
0
votes
0
answers
37
views
How to list categories only related to enabled entries or disabled child entries
Edit: solved in comments
My entries are set up as a parent > child structure. A single entry can either have children or not have any. If parent has children, the children entries are put in a ...
1
vote
1
answer
39
views
Craft CMS Utilities misses email option
I'm new to craft and I have to make a school project.
At the moment I'm stuck when it comes down to sending emails.
When a visitor lands on a page it can choose to subscribe to a fictional newsletter.
...
1
vote
1
answer
30
views
How to disable/enable all entries in a channel?
I have a channel named Parts. And there are 160k+ entries in it. I originally imported them into the channel using the "Feed Me" plugin. But none of the entries will show up in search ...
1
vote
1
answer
19
views
Can't disable entry versioning
I've got a page with:
15+ sites (are used for serving different languages),
a structure with matrix blocks and super table blocks inside them.
It took almost a minute to save an etnry, so I disabled ...
0
votes
2
answers
30
views
Retour plugin pages blank
After directing our domain to the server, the Retour plugin has shown only blank pages, with "No relevant data" messages displayed instead of information.
However, we are able to create ...
2
votes
1
answer
53
views
New Laptop - Developing Existing Project Locally
I've got a craft cms 4 website that I've been developing locally on my old PC and I've also got hosted with Servd Host. I've just got a new mac and I'm trying to get my project running locally on it ...
1
vote
1
answer
39
views
Show related entries of a parent, where only a child of that parent is selected as a related entry
I use a structure section with two levels, parents and children. Is it possible to show related entries of a parent, where only a child of that parent is selected as a related entry?
I did try to ...
1
vote
2
answers
35
views
testing if oEmbed field is empty fails
I am using the 'oEmbed' plugin and I have an oEmbed field with the handle videoUrl.
I am trying to do something very basic - to test if the field is empty.
I am not sure why it fails. I have tried the ...
0
votes
0
answers
57
views
In Craft 4, how can I disable the SSL local issuer certificate verification for any cURL requests?
In Craft CMS 4, for testing purpose only in a local environment, how can I disable the SSL verification (probably using verify_peer and verify_peer_name set to false) to all cURL requests, and ...
0
votes
0
answers
39
views
How to order entries by two fields, one being a date, the other being a time?
I would like to order my entries first by date, and then by time. So if several entries are on the same date, they will be ordered by time within that day.
This is my query:
{% set query = {
...
0
votes
0
answers
30
views
How to export a list of customers per domain?
I got a Craft (-v 3.7.67) Commerce (-v 3.4.20) setup with 4 sites in two domains.
I need to export a list of customers (or users, in my case users are 99% customers) per domain (so users that have ...
2
votes
1
answer
50
views
Can't upgrade to v4.x after migrating from nitro to ddev – db connection weirdness
I've been through the following steps on a local instance of a Craft 3.x project:
Followed Migrating from Craft Nitro to DDEV and got the instance running on DDEV
Updated to latest version of Craft 3:...
1
vote
1
answer
52
views
I'm trying to remove transforms if my image is an svg? Any tips or advice would be great
{% for icon in icons %}
{% set image = icon.icon.one() ?? null %}
{% if image %}
<div class="c c-md-6 c-lg-6">
...
1
vote
1
answer
92
views
Customer Controller and downloading a file (Apple Wallet - using PKPass library)
I'm trying to create a controller for a user to download a membership card as a pass in Apple Wallet. I'm looking to use the PKPass Library.
I've got things set up and working using their example like ...
1
vote
1
answer
225
views
How to add additional features (plugins) to ckeditor5
using the new ckeditor5 and want to include additional features
https://ckeditor.com/docs/ckeditor5/latest/features/text-transformation.html
I want to convert quotes ("") to european quotes (...
0
votes
0
answers
42
views
Class "modules\jobs\GenerateSocialCard" not found
Following this article, I'm trying to generate an image from html on Entry Save, but I'm getting an error when trying to push a job GenerateSocialCard to the Craft queue.
I'm using the default Module. ...
1
vote
1
answer
83
views
Generate an Image from Title
I would like to generate image automatically on entry save, using the entry Title and a specified image as a background.
I was thinking to use the Preparse Field plugin, but it seems like it's not ...
1
vote
1
answer
70
views
Programatically enable an entry
I'm creating to updating the title of some entries via a content migration, but this apparently doesn't work on disabled entries. So I'm trying to enable the entries to start, but that is also having ...
1
vote
1
answer
38
views
Excluding entries in an entry query with an array of IDs (PHP)
This seems more like a PHP question than a Craft CMS question, but since it's related to an entry query I'm trying to create I figured someone from the Craft community might know. I'm having trouble ...
1
vote
1
answer
40
views
Update array inside array
So I've read all the posts and followed along at home. I'm not a CS major. I have an array:
{% set testArray = {
name: "John Doe",
email: "[email protected]",
players: [
{
...
1
vote
1
answer
52
views
Is manual payment possible for Craft Commerce subscriptions?
I need to allow manual payments for Craft Commerce subscriptions. Typical users for this industry sector require an invoice and then make a bank transfer, and don't want to use credit card. It's low ...
1
vote
1
answer
31
views
Get default field values on pre-existing elements
related to How can I populate a dropdown via table field type using the default values?
I created a table to be used for ordering a display via the order of the table, with a bunch of default values ...