What's the deal with Deno? We talk with a major contributor to find out. Listen now.

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

How to get my craft projectConfig settings inside JS on the front end

So I am trying to work with twig templates and I want to inject my project configuration in my js so I can use it. I can do this {% set admin_email = craft.app.projectConfig.get.email.fromEmail %} ...
1
vote
1answer
28 views

Get entry by language in a module

I'm trying to get some auto translating done in a craft module. In order to do this I need to get the entry of another language in a save event. Is it possible to get this by language? Event::on( ...
1
vote
1answer
31 views

What is the best way of managing multisite propagation post setup phase?

I have a multisite setup with a pages section. In the future we want to add additional sites but there seem to be some caveats. When we first setup pages we set the section propagation to 'all other ...
1
vote
1answer
31 views

Register custom REST routes while building a plugin for Craft 3

I am building a custom plugin for Craft and I am hitting some REST APIs in my backend service to fetch some data using Ajax calls in JS. What I would like to do when the AJAX calls complete and come ...
0
votes
0answers
25 views

How to write multiple operator condition in where statement of db query

$query = (new Query()) ->select([]) ->from(['{{%custom_table}}']) ->where(['<=','firstDate', now()]) ->all(); In craft3, I want to add multiple ...
1
vote
0answers
43 views

Test Craft Plugin without the use of a database

We'd like to add Unit Tests to our Craft Plugin. I have used the Plugin Factory generator to generate the files and the basic setup seems to work. I am however struggling getting the tests to work ...
0
votes
0answers
37 views

How to automatically set time in a date/time field?

For a specific kind of entry I need the time in a date/time field to either automatically display as 23:00/11pm on the user dashboard, or, permanently set the time on that date/time field to 23:00/...
0
votes
0answers
23 views

Is it possible to get a users most popular categories based on Craft products?

So i wanna show the user the product categories that is most popular for that spesific user. Is that possible?
1
vote
1answer
76 views

Work with data/content from entries

I'm usually working on Backends with PHP and ZF/Laminas. Now I'm building a headless (only Backend) Craft CMS website and have a couple of questions that I didn't find a clear answer on. The Craft ...
1
vote
1answer
37 views

How to use createFromString() in Craft 3

In Craft 2 I've used createFromString() as following: DateTime::createFromString($pubDate, craft()->timezone) But if I use this function in craft cms 3 then I'm getting the following error: Call ...
2
votes
1answer
27 views

Unavailable plugin during migration to craft 3

During a migration from craft 2 to craft 3, I stumble in 3 issues with plugins. Plugins are not available in craft 3. For example,"instablog" plugin Reinstall paid license plugins. Custom plugins. ...
1
vote
1answer
133 views

Checking which version of Craft CMS a site is using

I've been asked to look at Craft CMS site where my would-be client has been ghosted by his previous developer. I have no handover information and only FTP and phpmyadmin access presently. Looking ...
1
vote
1answer
16 views

Output specific entry from entries field based on position

I have an entries field in a section, I am looking to output a certain selected entry from this field based on its position. For example I want to out the 2nd or 3rd entry only from this entry field, ...
0
votes
1answer
25 views

Is this level of server CPU usage normal? Solspace Calendar 3

Digital Ocean graphs are below to see what I am referring to but it seems like this plugin is using an inordinate amount of power for what it is doing. As far as I can tell it is directly related to ...
1
vote
3answers
46 views

How to add content to pages using a plugin?

I am developing a plugin for Craft 3. And I am trying to add some content to all pages in the CMS using this plugin. How can I do that? Is there a method or class call I can use for this? I am not ...
1
vote
1answer
23 views

Images not showing even after bundling them with asset bundle

So I am trying to build a simple plugin for Craft CMS and I am wish to use my assets in the twig template like css, js, images etc. From what I have read and understood from Asset Bundles, I have ...
1
vote
1answer
13 views

Show a list of pages but hide the current page from the list

My setup I'd like to show a navigation menu listing all my page entries. In my layout file, I include a template for the navigation: _layout.twig: <main> <section id="nav"> ...
0
votes
0answers
12 views

Plain text fields defaulting to curly quotes in editor

I’m running into an issue on my Craft install where plain text fields are automatically being styled with fancy quotes within the backend, particularly in cases of opening and closing quotes. It does ...
1
vote
1answer
26 views

Have SEOMatic render a custom SEOMatic field

I've got a few pages on my site that are not content managed. I don't want to create entries for these pages, but I do want the SEO for these pages content managed. My solution here has been to set ...
1
vote
1answer
23 views

How to use assets while building Craft CMS plugins?

I am trying to build a basic plugin, when installed has a single nav bar item, and of course a twig template which shows up on clicking on that navbar item. I have used the basic template to extend ...
2
votes
1answer
22 views

CraftCMS Redactor is adding <p> tags to viewable source code… but then removes them when saving

We are in the midst of a migration from WordPress to Craft. Much of the content contains line breaks, which are converted to <p> tags in Redactor (as seen in Redactor's view source plugin). ...
0
votes
0answers
17 views

Default stock levels when importing Commerce products with FeedMe

I've got a Commerce 3 store where the customer maintains the majority of the product listings by updating a Google Sheet, very few fields are edited via the Control Panel. However, now they are ...
1
vote
1answer
27 views

Feed me: set entrytype dynamically

Can someone confirm that when importing entries with Feed-Me, the entrytype can NOT be set dynamically based on a field of the feed?
0
votes
0answers
11 views

Feed Me: import assets with folder structure when importing entries

Can someone confirm that is currently not possible to take the folders (directories), into which an asset are imported, from the feed, when importing entries (with assets it seems to be possible)? I ...
0
votes
1answer
87 views

Is there a guide for using Craft Commerce headless?

I’m trying to figure out the work involved in using Craft Commerce in a headless setup. Is it possible? I think so. How do I expose the Commerce functionality via an API, instead of through Twig ...
1
vote
1answer
39 views

How to change the Craft 3 activation email?

In my organization many of the employees believe the user activation email sent out by Craft is spam. How do I change the email text and possibly add an image, like our company logo, to the email?
2
votes
1answer
45 views

Set default status in CP admin for queried entries from “All” to “Live”

Just wondering if there's a way to set the default status for the entry listing pages in the admin, in my case from "All" to "Live". This would need to account for a page "refresh" and navigation ...
2
votes
1answer
40 views

Admin and Dashboard showing 404

I am deploying a Craft site, I have it installed and everything is working fine, but whenever I try to access the admin panel I get a generic 404. I have tried every solution offered in similar ...
1
vote
1answer
28 views

Getting invalid verification code for email confirmation

I am using Craft CMS as a backend for react Next app. On our live site we are sometimes getting complaints from the user about error when user try to verify code sent in the email. This case doesn't ...
0
votes
0answers
33 views

Super Table fields in Matrix blocks not automatically propagating content across sites

Please bear with me as I try to explain what's going on. Feel free to ask for more details if needed. Simply put, Super Table fields in Matrix blocks are giving me trouble for multi-site. I am ...
0
votes
0answers
21 views

Max Backups General Config Is not removing old sql backup files

Reading the docs here https://docs.craftcms.com/v3/config/config-settings.html I was under the impression if I set this config in my general config it'll delete my db sql dumps in my storage folder ...
1
vote
1answer
12 views

entry is available without query when templates are set in the CP, is this an acceptable method?

Craft Pro 3.4.20 New to craft development. I was following the documentation and calling my entries via the suggested method as outlined https://docs.craftcms.com/v3/dev/element-queries/entry-queries....
0
votes
0answers
61 views

Date Field Validation by PHP plugin

I have a form for updating user info, with a field of birth date. However, I am struggling to develop a validation for this date field by PHP. Its frontend code is this; {% set tz = craft.app....
1
vote
0answers
99 views

Feed Me - feed format for importing into Super Table field

I am trying to import a list with the following format in each list item: <Date> - <Title> - <Icon> - <External Link> into a Super Table block containing fields for each of ...
1
vote
1answer
35 views

How to get the previous or next two entries with images and

To expand upon How to get the previous or next two entries I was wondering how I can also add the image and an input from each entry. I have simplified the html-structure in this example but ...
1
vote
2answers
30 views

Query Entries based on current Entry's related Entries

I'm wanting to show related articles based on the current article's related Markets. How do I get the current markets and filter relevant posts based on those related markets? This is what I have so ...
1
vote
1answer
34 views

How to create a category filter for a portfolio site?

I want to create a category filter similar to this website http://www.mypoorbrain.com/ (just a random website i found with the desired effect). Basically I want the categories to be displayed ...
1
vote
1answer
21 views

Existing contents get deleted on Live Preview when adding new content on a matrix field

When I add a new content for a matrix block field on an existing entry, all its previous contents gets deleted from the Live Preview, except for the editor which still has the previous contents. And ...
1
vote
1answer
25 views

How to disable the Javascript “actions/queue/run” on frontend?

After upgraded our Craft from 3.3 to 3.4.14 we have noticed that there is a new Javascript on the footer of the homepage (frontend) that runs "index.php?p=actions/queue/run". We run the tasks via ...
1
vote
1answer
28 views

How to search based on a Multi select category field in Craft 3?

I have a blog section with multi select categories. I want to filter all the blogs based on that multi select categories in the website. When I tried .search('category:ui-ux OR category:web-designs')...
2
votes
1answer
55 views

Dynamically populating select input fields using jquery $.load and twig template

EDIT: the below code now works! I have two select inputs, the choice of 1 should populate the second. I have an external twig file (data.twig) (MAKE SURE TO PUT THIS IN YOUR TEMPLATES FOLDER) that ...
0
votes
0answers
19 views

Add additional entry fields to backend search

The search field in the craft backend entry section searches the title and slug field by default. Is it possible to add custom entry fields to this search function (in my case e.g. a custom item ...
1
vote
1answer
43 views

What is causing Craft CP assets(JS/CSS) to appear in front-end pages?

Perhaps in some way related to this, I've got a couple of front-end pages on our website that pull in the following files, which seem to all be CP files. These two pages each utilize plugins I've ...
0
votes
0answers
32 views

How to add new Matrix block to entry field in php?

$draft = new Drafts(); var_dump($entry->slug); $draftEntry = Entry::find()->slug($entry->slug)->one(); $draftEntry->typeId = 32; ...
1
vote
1answer
21 views

“Field Limit is too big for your chosen Column Type” error on already existing fields when updating matrix

I'm getting the following error when I'm trying to update a matrix: "Field Limit is too big for your chosen Column Type."" I'm trying to add a new block type but this error keeps getting up on ...
1
vote
1answer
37 views

Can fields be reused with a different name per section?

I've got a redactor field used on several sections, and category groups. Is there a way to change the displayed name per section in the edit form? On a category group the field is, 'Category ...
0
votes
0answers
11 views

Craft Commerce cart carrying over to other sites

I've never noticed this before and am wondering if this is what is supposed to happen. I have my main site and a subdomain set up, I've never noticed my orders carrying over from one site cart to the ...
0
votes
0answers
15 views

Redactor Link Encoding create 404 errors

Has anyone come across scrambled link encoding in Redactor resulting in 404 errors? How do we solve this? What should be: https://www.dazeddigital.com/​f​a​s​h​i​o​n​/​a​r​t​i​c​l​e​/​3​3​0​3​0​/​1​...
1
vote
2answers
40 views

Frontend Form Search Users based on Tags

Context: I'm trying to build a search form that will filter users based on Name, Skills and School. Users who have any of the search criteria should appear in my results. Name Is a fuzzy keyword ...
1
vote
2answers
38 views

How to display multiple entry loops on the homepage (Single section type)

I've been learning Craft 3 for a couple weeks and I've run into a little snag. I have a homepage that I would like to display multiple entry loops and/or types. However, I cannot find how to do this ...

1 2
3
4 5
32