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
144 views

Craft CMS throws Internal Server Error 500

I got given a Craft CMS project build with composer and npm. Pointed valet to the correct folder, installed all the dependencies and started the app with npm run watch. http://localhost:3000 just ...
1
vote
1answer
36 views

Prevent adding users with same email addresses

I am adding new users inside of the Craft controller as part of the frontend user import script. This is the code: $user = new User(); $user->pending = true; $user->username = $email; $user->...
1
vote
1answer
119 views

How do I get the siteName in a module (Craft 3)

In templates I can do something like {{siteName}}. But how do I retrieve this in a module? I've tried: Craft::$app->config->siteName I can grab my custom globals via Craft::$app->globals, but ...
1
vote
2answers
36 views

How to search on multiple (custom) fields using Element API

I am using the Element API to search for entries that match a search query: either the title OR the excerpt should contain the query term. The entry is very simple and has these fields: -title -...
1
vote
2answers
43 views

Filter Entries by Custom date

I want to output all entries which match with a given year from a custom date field. The year is a string I get from slug. I am using Craft 3.5.16. What did I do wrong? {% set catYear = craft.app....
1
vote
1answer
100 views

How to include external JavaScript in place?

We include an external script from a vendor and the URL doesn't end in .js. It returns JavaScript that creates a widget in place. I was able to fake it out by adding a '&js=.js' parameter but it ...
0
votes
0answers
23 views

Craft Commerce - On the fly product / product from entry form

Good Evening. Does anyone know if the following is possible within Craft Commerce Can data from normal entries be used to populate a one-off on-the-fly product? Can an entry form be used to create ...
1
vote
1answer
25 views

What are the yaml files in config/project? Should I commit them?

See the title. I'm currently committing the YAML files to our git repo so they deploy to our production server. Is that appropriate? Should I ignore the config/project folder?
1
vote
1answer
17 views

Commerce - Email users on new product input

Good Afternoon, Is it possible to have Craft email a list of users (based on a category) when a new product is added to the shop? Is there a pluigin that would do this, or is it a matter of a small ...
0
votes
0answers
17 views

Freeform Pro Plugin Submission to Google Spreadshet

I have a perfectly working form using the Freeform Pro plugin on a CraftCMS 3x installation, however I'd like to allow team members access to the submissions without having to login to the CraftCMS ...
1
vote
1answer
12 views

Email notifications solspace calendar

I'm considering the Solspace Calendar plugin for a project. Can the plugin send automatic e-mail notifications when an event has been submitted from the front-end? Can the plugin save events ...
0
votes
0answers
59 views

CraftCMS cookieValidationKey must be configured with a secret key inside Docker Container

I am using CraftCMS, and I am getting this error: Invalid Configuration – yii\base\InvalidConfigException craft\web\Request::cookieValidationKey must be configured with a secret key. The longer error ...
1
vote
1answer
30 views

How to translate a structure url

I'm working on a multilingual website where I have one structure called Products. Currently, this structure's URI format is configured like this: {parent.uri ?? section.handle}/{slug} Which returns ...
0
votes
0answers
26 views

Solspace Calendar: Allow guest access

I'm working with Solspace Calendar and need to allow guest access to post events to a calendar. I'm currently only working with the demo templates and have guest access turned on. But I seem to be ...
0
votes
0answers
11 views

Redactor Richtext. Editing a Link with an “&” breaks the link

Both screenshots were done without saving the entry. Just adding the link inside redactor and opening the edit menu again. Adding a new Link After pressing add and edit the link again You can see that ...
0
votes
0answers
14 views

Possible to clean up elements_sites?

We have a website that has around 80k users per month and we're updating around 1k entries per night due to stock updates. The site's been live for almost 2 years and the CMS has become really slow ...
1
vote
1answer
81 views

How to use Sprig's “Load More” Recipe After Update

This is a continuation of a previous question I had (Here). I am using Sprig's Load More Recipe. In my category page, I want the load more function to only pull up entries that equals the current ...
2
votes
1answer
84 views

Site url is not generated correctly when using environment variables

I'm working on a multi-site setup (for a localized website). In my .env file, I have defined a SITE_BASE_URL variable. Then, in the control panel, I set up each site's base url with that environment ...
1
vote
2answers
46 views

Specify a specific entry type in paramaters

I am currently searching within multiple sections on my site. I'd like to limit one of the sections (courses) to a specific entry type (cce)? Any help would be greatly appreciated! {% set params = { ...
1
vote
1answer
27 views

Add Redactor field to searchindex

Is it possible to add a redactor field to the search index? I'm importing about 160 posts from a WordPress blog and the client has said it is absolutely essential that the posts themselves are ...
1
vote
1answer
30 views

Craft CMS: Data too long for column 'cacheKey' at row 1

We have Craft CMS v3 using multi-sites. We are using cache to cache whole pages based on the absolute URL as some URLs have query parameters which seem to be ignored when not using a key. So the ...
0
votes
0answers
19 views

Migrating assets from remote volume (Cloudinary) to local folder

I need to migrate an asset volume from Cloudinary to local folder. What is the appropriate strategy to execute the change while maintaining database integrity? Can I simply change the volume type to ...
0
votes
0answers
51 views

Manually sort entries related to a category in the admin

Is anyone familiar with a way (in the admin) to manually sort the order of entries related to a category? For example, a "Software" entry gets assigned to multiple categories during entry. ...
2
votes
1answer
82 views

Is there a name for Craft 3's database model?

I find Craft 3 to have a very clever database structure which eschews all of the issues I've seen with EAV. Despite contrasting the differences between Craft 3's model and EAV, I'm having difficulty ...
0
votes
0answers
12 views

Modying SEOMatic field in events

In a Element::EVENT_BEFORE_SAVE event within a custom module I'd like to set an SEOMatic field. setFieldValue doesn't work presumably because it's a custom field, is there any reliable way to do this? ...
1
vote
1answer
34 views

A user deleted my craft Admin account, what to do?

A created user was able to delete the Admin account, now I can't log in Craft anymore with an admin account. How is it possible that a normal user can delete an Admin? I'm in contact with this user to ...
2
votes
1answer
30 views

Partially pay for an order

Is there any way of partially paying for an order, so if the order total amount was $100, how can I programmatically set the payment amount to $50, and then pay the other $50 using another payment ...
0
votes
0answers
116 views

Workflow for running Craft CMS with Docker in production?

I've been looking into running Craft CMS with Docker in production. One of the most helpful and comprehensive resources I've found so far is Matt Gray's blog series. While it goes into great depth, I'...
1
vote
1answer
45 views

There are no sites in the config file on nitro add

When i try nitro add command to they return "There are no sites in the config file" what should i do? Unable to locate a webroot, setting to web. Enter the webroot [web] web Added tutorial....
0
votes
0answers
33 views

Add matrix block content to newly created Entry

Help. I feel this is almost basic and many have asked similar questions, but I cannot get this to work. I have an entry type which amongst other things has a Matrix field ph_selectorViews, which has ...
1
vote
1answer
43 views

Is it possible to duplicate an entry as not enabled/live from the listing page?

Is it possible to duplicate an entry as not enabled/live from the admin listing page? Just this means some user put pages live on the site that are just copies - they forget to quickly change it to ...
5
votes
4answers
8k views

“Unknown package has no name defined” composer error on upgrade

Upgrading from Craft 3.4.20 running Composer 1.10.17 on PHP 7.2. Running ./craft update all returns the following error: error: Unknown package has no name defined. [followed by JSON object related to ...
1
vote
1answer
54 views

Testing database credentials Craft 3 Setup

When i try setup db in craft 3 at windows with composer using php craft setup/db command it give me Which database driver are you using? [mysql,pgsql,?]: pgsql Database server name or IP address: [127....
0
votes
0answers
22 views

Use entry field in redactor

As an affiliate I want one field where the links are stored, this link is saved as an entry. I've tried to call the template_from_string function but variables in the url are not overwritten. Is there ...
1
vote
1answer
62 views

Craft Commerce 3 Decrease line Item qty by one?

I may be missing something obvious but I'm trying to update a +/- quantity button system for adding products to work on Craft Commerce 3 The desired functionality is that click '+' increases the cart ...
0
votes
0answers
14 views

Entry ancestors is null in dynamic asset subfolder path or during EVENT_AFTER_SAVE event

I'd like to use the slug of the top-level entry in a structure in an asset's dynamic folder subpath. I have a structure where the entry I'm concerned with for this question can sit at either the ...
0
votes
0answers
39 views

Add new translation app.php file in Craft

I'm trying to add a new language file in Craft Control Panel admin site. I have created app.php inside translations/vi folder like this: -my app folder |-- translations |----- vi |-------- app.php ...
3
votes
2answers
40 views

Twig search function doesn't work after upgrading to Craft 3

My client's Craft 2 site includes several templates which use search functions to return a product entry by an ID, like so: {% set product = craft.entries.section('Product') .search('...
1
vote
1answer
125 views

Craft 3 - Twig search query for entry with custom EntriesField containing disabled entry

I have a search form with 1 simple input (q) I also have 2 sections: SECTION-A & SECTION-B The search is for entries within SECTION A. The entry I'm searching for contains a custom entriesField ...
0
votes
0answers
22 views

Load category values based on another category field

I'm really new to Craft CMS, I have a site where I need to do something like this: There are 2 categories, Brand and Model (Models have a relation to Brands via category field). In entries I have 2 ...
1
vote
1answer
63 views

Filtering by lightswitch fields

Bit of an unusual one and sure must be missing something but know if we have a defined lightswitch field we want to filter against it can quite easily be done so like this: {{ craft.products().myField(...
1
vote
1answer
16 views

Entries field templating only when entry is added

I have a section type Structure called How to videos, in which I have field type Entries. Now, when I select "Products" in the field type 'Entries'. I only want the selected Entries Products ...
1
vote
1answer
99 views

Maintaining and deploying many multi-site from a single codebase

We're developing an application that uses a multi-site Craft back-end with a JS front-end, making use of GraphQL. The intention is to maintain a single codebase that can be used to deploy new and ...
1
vote
1answer
28 views

returning HTML in $event->sender->addErrors doesn't work

I have a plugin which is checking if there is a duplicate entry before save. I'm trying to give the user back an anchor to the entry which exists so my client can switch without searching for it in a ...
1
vote
1answer
47 views

Image Transforms not generated - permission problem?

Since I installed my Craft based website on the production server the image transforms are no longer generated. The tasks runs through more than 5000 images but doesn't generate new ones. There have ...
1
vote
1answer
64 views

Do the number of Sites in a Multi-Site have a practical limit?

My use case is creating microsites for hundreds to thousands of customers, allowing them to edit/create their own site. Currently it is set up with channels with auto-created entries for users and no ...
1
vote
2answers
43 views

Twig template outputting blank page on non-“dev” environment

I've created a base twig template which contains some basic "maintenance mode" logic. This works perfectly as long as the main ENVIRONMENT in the .env file is set as dev, but fails for ...
1
vote
1answer
110 views

Deleting Duplicate Fields Brings down Craft Website and Server

I have somehow managed to duplicate some fields in my Craft install (see image of unused fields). When I delete the unused duplicates I create a server error and can't access Craft. To rectify I had ...
1
vote
1answer
44 views

Craft search only shows results matching 'title' of entries

I´m doing a search on Blog entries, i want to get all relevant entries searching on several fields, and seems that only matches the title. I try already using search(query), now i added the fields, ...
1
vote
1answer
199 views

Input and Use Twig Variable in External JS Script Across Different Pages

I have created a _layout.twig file which acts as my base to hold content on the page -> _layout.twig: <!DOCTYPE html> <html lang="{{ craft.app.language }}"> <head> ...

1 2
3
4 5
34