Questions tagged [craft4]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
11 views

Error on plugin settings page: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

I've installed the latest CraftCMS version via composer. When I'm visiting the plugins settings page (/web/admin/settings/plugins), I get the following error message: preg_replace(): Passing null to ...
Odin's user avatar
  • 1
0 votes
1 answer
23 views

Migration failed - table already exists

I'm stuck in a "migration" that is trying to install a table which it clearly didn't check for (because yes, it is quite already there.) When I remove the table and allow the migration to go ...
Caroline Blaker's user avatar
0 votes
1 answer
13 views

How to call and print only Event Types of Event Plugin

How to call and print only Event Types (title and handle of event types) of Event Plugin -> https://verbb.io/craft-plugins/events/features
user14621's user avatar
1 vote
0 answers
18 views

how to add an if to open an external link in the menu

I have a code that I am using to make the menu I created in Craft CMS work. In my menu, I have direct and indirect links. and I also have a child option that uses an EXTERNAL link. In other words, the ...
Ana Viana's user avatar
0 votes
0 answers
17 views

como adicionar um if para abrir um link external no menu [duplicate]

eu tenho um codigo que estou utilizando para que o menu que criei no Craft CMS funcione. No meu menu, possuo links diretos e indiretos. e tenho também uma opção de filho que usa um link EXTERNO. ou ...
Ana Viana's user avatar
1 vote
1 answer
32 views

Craft 4 DB connection works in WEB context but not from Craft's console command

We just completed an upgrade from Craft 3 to 4 (latest version) and now all web requests (FE+CP) work, but not the console commands, it can not connect to the database ./craft users/list-admins ...
Matthias Redl-Mann's user avatar
1 vote
1 answer
38 views

Money field with dynamic currency selection

I'm working on a multi-lingual site and we need to output costs for products. This is NOT a Craft Commerce site however. I need to show different costs per site depending on the location and different ...
SplendidRob's user avatar
1 vote
1 answer
28 views

Omit specific URLs from the sitemap

I want to exclude certain URLs from the sitemap, depending on the custom field settings in their corresponding entries. I'm using SEO Matic plugin in craft4
Thangaraj Moorthi's user avatar
0 votes
0 answers
14 views

Setting title in Instant Analytics GA4

I’ve installed Instant Analytics GA4 (https://nystudio107.com/docs/instant-analytics-ga4/) The default title is the template (which is a bizarre default IMO) as a result all of my analytics are ...
mitrol's user avatar
  • 252
1 vote
3 answers
63 views

Debug Toolbar Not Displaying on frontend

I just updated a site to Craft 4 and the debug toolbar no longer shows on the frontend, but does show in the CP. Have not had this issue with other sites that were updated. Any ideas?
Roi Agneta's user avatar
  • 1,413
0 votes
1 answer
44 views

Transfering content from my local docker environment to production

For the second time, I've created a website with CraftCms. This time, I used my windows computer to setup the project but I had to use docker. Fyi, I'm not experienced with docker, but I was ...
Stef Verniers's user avatar
0 votes
0 answers
19 views

I get a 404 not found when going to my site url, but content will show when navigation to url/craftfolder/web

I've made for the second time a craftCMS website. But is goes wrong at the deployment. After many times of trying, I got it kinda working when going to siteurl/craftfolder/web. In that case the ...
Stef Verniers's user avatar
1 vote
1 answer
37 views

Create section 'landing page' with 'two column block'

I'm very new to Craft 4. I have a matrix 'Landing Page Blocks' I've created 2 Block Types: Hero Block and Two Column Block Within the 2 column Block I need a left and right content block Within the ...
user3086053's user avatar
1 vote
1 answer
34 views

Calling a Function From Private Plugin

Writing my first plugin. Scaffolded with Generator and is active (appearing in admin). This is where most tutorials leave you on your own so hoping to get some help calling a simple function in my ...
Jason McKinney's user avatar
1 vote
1 answer
37 views

Image Editor: Remove "focal point" and "custom"

Is there a way to remove "focal point" and "custom" options from the image editor? Custom ratios are documented here: https://craftcms.com/docs/4.x/config/general.html#image-...
Marc 's user avatar
  • 75
2 votes
1 answer
25 views

Get list of user logins

I would like to get a list of every login of a user. I know I can get a certain user with craft.users() but as far as I have seen, I get data for lastLoginDate only. Is there a way to get a complete ...
obs's user avatar
  • 487
1 vote
1 answer
41 views

Image path is broken after updating site from Craft version 3 to 4

I am currently in the process of upgrading my site from 3 to 4. My craft CMS version is 4.4.16.1 None of my images are loading in the site after performing update. Our images are stored in AWS. Upon ...
Sajjan Shrestha's user avatar
1 vote
1 answer
28 views

Sort articles by seq() value

Im trying to create a view for most viewed articles. I tried with entryCount plugin as recommended here but unfortunately, when you have more than 500 articles in the last 3 weeks that I'm checking, ...
Mensur Hafizović's user avatar
1 vote
1 answer
22 views

Alias not being resolved directly within an attribute in Twig templates

Is this a bug or is this me ? (I'm a new to craft) When using the @web alias directly within an attribute in a Twig template, the alias doesn't seem to be resolved to its corresponding URL. Instead, ...
arche's user avatar
  • 13
0 votes
0 answers
44 views

composer update for Craft 3 to Craft 4

Trying to migrate a site from Craft 3 to Craft 4. Carefully followed the instructions to update my composer.json file to reflect the Craft 4 versions of Craft and all plugins. When I run composer ...
Roi Agneta's user avatar
  • 1,413
0 votes
0 answers
27 views

Disable specific search syntax with colon

I have a search page which searches in products. Unfortunately some of these products contain a colon : in the title. This triggers the search syntax that is built into Craft. How can I disable this ...
Matthias's user avatar
0 votes
0 answers
63 views

Content revision issue for every code deployment

The content reversion issue was reported during the production deployment of a new module on the Craft CMS site. To address this issue, we suspect the below deployment scripts are causing the content ...
JohnC's user avatar
  • 61
1 vote
1 answer
56 views

Default language is accessible without locale in URL

I have a website with 2 languages. Each language is setup as a different site. Each site has its own base URL which is defined as follows: @defaultUrl/en and @defaultUrl/fr. I have created a new ...
Matthias's user avatar
1 vote
1 answer
24 views

How can I edit a view entry from the view, such as a lightswitch check, without opening up the form?

In Craft CMS I can see views of my my entries through singles, structures, or channels. I can see a lightswitch checkbox have a green check in the view. I'd like to be able to edit the view directly ...
coydecoy's user avatar
0 votes
1 answer
33 views

Add chosen location in URL and show content accordingly

We're building a website for a company with multiple locations which need different content but based on the same templates. I currently have a section Locations. What I want to achieve is to ...
Matthias's user avatar
2 votes
1 answer
104 views

OPcache extension Warning

I updated my Craft installation to 4.5.3, right? And then I noticed this warning pops up in the system report, saying, "The OPcache extension is recommended in production environments." ...
JBrew30's user avatar
  • 102
0 votes
0 answers
23 views

Does descendantOf only accept a single value?

I have a products page on which I'm filtering with Sprig. There are some categories in the form of checkboxes. These categories have some subcategories. The categories are a structured section with ...
Matthias's user avatar
1 vote
1 answer
33 views

Big upgrade completed locally, how to upgrade live?

I have a site that was Craft 3.4 and Commerce 3.x (unsure of exact version). Locally, I've been spent a big chunk of today updating to the latest versions of everything and making sure all still works ...
Jaytrix's user avatar
  • 187
1 vote
1 answer
62 views

Craft CMS 4: Update without proc_open

I've recently managed to upgrade my Craft installation from 3.9.1 to 4.5.0. During the upgrade process I had a number of times where the update process from within the admin GUI 'failed' or at least ...
Marty's user avatar
  • 11
0 votes
0 answers
25 views

Feed me with Google sheets and matrix fields

Our client delivered a list of products in the form of a Google Sheet. Some products contain some extra information which should we presented in the form of a list on the website. Currently these ...
Matthias's user avatar
0 votes
0 answers
24 views

Codeception Unit test using fullMock

I have a custom field for which I would like to write some basic unit tests. I was looking into fullMock: true since really don't need a full Craft environment. I want to test the normalizeValue() ...
thomas's user avatar
  • 131
0 votes
0 answers
18 views

How to adjust entry fields to have different width based on field value in Craft CMS 4

I have created a entrytype where there are multiple sets of fields. One for each of 4 different languages. In the entrytype i have selected a field of checkboxes and added conditional logic for which ...
Coledevelopment's user avatar
1 vote
1 answer
65 views

Create deep copy of twig variable

I'm building a filter page with Craft and Sprig. The goal is to show the amount of products for each filter. So for example if we want to filter on color we show 2 checkboxes "Red" and "...
Matthias's user avatar
0 votes
0 answers
55 views

Craft cms[4.x]: Frontend Site broke after performing a feed with feed me

On our last data migration from wordpress i import through feed me all the data but the postDates. 31-08-2023 11:12 I imported a csv file in feed me with all the posts content including the postDates ...
Adam Fernandez's user avatar
1 vote
1 answer
85 views

I can't update the craft CMS. Returns an error

CRAFT CMS 4.5 has been released. I have updated to this version calmly. There are new updates 4.5.1, 4.5.2, 4.5.3. But when trying to update the system, it gives this error: Ошибка: The command "...
Dimi's user avatar
  • 273
1 vote
2 answers
36 views

Conditional - Apply After Every Third Loop

The following is messy and obviously not scalable. There must be a way in twig to target a common difference of 3 right? {% if loop.first or loop.index == 4 or loop.index == 7 or loop.index == 10 %} ...
Jason McKinney's user avatar
1 vote
1 answer
60 views

How to completely disable entry versioning(drafts) during editing

Obviously I disabled it in the section settings: I just want to save the entry after making all the changes, but now it's trying to save the revision after each single change
Nikolay Bronskiy's user avatar
0 votes
0 answers
25 views

Disable URL's for nested levels in structure but keep URL's for the 2 top levels

I have some products with categories that go 4 and sometimes 5 levels deep. The site will have an overview page for the first 2 levels. For example: my-website.com/category/subcategory I have created ...
Matthias's user avatar
0 votes
0 answers
24 views

Live preview button(s) gone after enabling different domain for control panel

I'm building a Craft website which will need another domain for the control panel. The setup for this has gone good using this article. => https://craftcms.com/knowledge-base/access-control-panel-...
Matthias's user avatar
1 vote
1 answer
75 views

Run craft up command in deployment pipeline without prompts

I am deploying a Craft website with Bitbucket Pipelines. Basically what it does is spinning up a container that runs composer install and builds my CSS and JS with webpack. The vendor folder and js/...
Matthias's user avatar
1 vote
2 answers
179 views

Craft 4, CKEditor 5, image resizeOptions not showing in image toolbar

I'm experimenting with all the CKEditor 5 config options and I like how the docs have the image resize (https://ckeditor.com/docs/ckeditor5/latest/features/images/images-overview.html#image-contextual-...
Amanda Lutz's user avatar
0 votes
0 answers
18 views

CP routes are suddenly prefixed by /web/ directory

I've deployed my website for a second time but there is a problem now.. When I navigate through my page, everything works fine apart from one page that fetches a graphQL query, but this returns an ...
Stef Verniers's user avatar
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 ...
joomkit's user avatar
  • 2,004
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 ("...
plaintxt's user avatar
  • 488
1 vote
1 answer
69 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?
joomkit's user avatar
  • 2,004
1 vote
2 answers
60 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 ...
thomas's user avatar
  • 131
0 votes
0 answers
25 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. ...
nitech's user avatar
  • 679
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 ...
Stef Verniers's user avatar
0 votes
0 answers
32 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....
George Bleasdale's user avatar
0 votes
1 answer
34 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 ...
Jaytrix's user avatar
  • 187