Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [craft3]

For use with questions relating to the Craft 3 version of Craft CMS, including the Beta and RC releases.

0
votes
0answers
6 views

Render Field from FieldHandler in FreeForm Craft CMS

Can we render some particular field from Our FreeForm plugin ? if we can please let me know how we can achieve it.
0
votes
1answer
15 views

Element API — Endpoint has an invalid elementType

I'm trying the Element API for the first time and getting this error message {"error":{"code":404,"message":"Endpoint has an invalid elementType"}} I cannot for the life of me figure out what I'm ...
1
vote
1answer
6 views

How to display Craft Commerce subscription description from a linked entry

I must be missing something obvious here but I don't see any reference to this in the docs. Under Commerce Settings > Subscription plans > You can link a related entry to the Description but it is ...
1
vote
1answer
20 views

How to run function after plugin installed?

How can I run a function when my plugin is installed? I tried SafeUp in migrations but it doesn't work.
1
vote
1answer
44 views

Is there any plugin for Blog in Craft 3?

I want to create a Blog website in craft cms. I would like to know, is there any plugin for Blog which we can use in Craft similar kind of WordPress?
0
votes
0answers
13 views

Setting a variable to a Matrix field with additional parameters

I'm trying to set a variable to a Matrix field and apply additional query parameters like so: {% set monthDates = entry.scanDates.type('dates').date('and', '>= ' ~ currMonthFirst|date('Y-m-d'), '&...
1
vote
1answer
23 views

CRAFT_BASE_PATH problems when installing Craft 3 in subdirectory

My client wants Craft 3 installed in a subdirectory of the main site. So I placed it in http://mainsite.com/subdir. The issue now is that the webroot for the domain is at http://mainsite.com, so my ...
1
vote
0answers
28 views

Sorting Entry Query Related By Custom Field

I am currently trying to speed up a website I work on, and would like to implement pagination as an index page is currently loading over 350 entries. Each entry has a relation to another which holds ...
1
vote
2answers
27 views

Turning off a site in multi-site/multi-environment config

Given a multi site setup (domain1.com, domain2.com) that also uses multiple environments (dev, staging, production) - how would one configure one of the sites to be turned off in the production ...
1
vote
1answer
24 views

Get entries based on multiple fields in controller

I am trying to get the entries based on multiple fields. Fields can be of type tags, checkbox, radio box, and number. In my controller currently what I tried is. $extrafilter will be like Array ( ...
0
votes
0answers
15 views

Rename files uploaded to certain sources in Craft 3

I have an event written for Craft 2 which renames files, which are uploaded to certain sources, to have a 35 character random string, plus its original extension. I am looking to update this for ...
1
vote
2answers
25 views

CP Asset thumbnails delivered by PHP

When listing entries with lots of assets (and therefore thumbnails), the server slows down significantly. I realized, that the assets all have the path: https://mypage.url/index.php?p=admin/actions/...
1
vote
1answer
24 views

Loop through all created fields and get the field type

I want to show some input fields on frontend template form. Type of input is dependent on the type of fields selected on the backend. For example, if the text field is selected in the backend I ...
1
vote
1answer
22 views

How to order Sites

We have 38 sites running, divided over 6 groups. But for some weird reason on showing the sites list, 10 sites are showing up random. How can we fix this, or how can we order the sites on 'name' or '...
1
vote
1answer
26 views

Cannot login to admin portal

When I try to login to the Craft admin portal, I receive a prompt that my login credentials are incorrect, even though I am sure I have them set to the correct value. Of note, this site is using a ...
0
votes
0answers
27 views

Hooking Event After Record Save

I have a custom module that is receiving data from an external API. I need to save some of that data into a record and return a success response, so far all is good. Along side this I want to set up ...
0
votes
0answers
15 views

An unknown error occurred message, only on live server

Please can anyone give me some pointers. Just logged into the backend on an older (but live) 3.0.26.1 project. CP is now flashing multiple 'an unknown error occurred' messages on every CP request. ...
0
votes
0answers
36 views

CSS folder with XAMPP and Craft Cms

I am using XAMPP with Craft CMS 3. I am doing the tutorial with craftquest. I have moved the stylesheets folder into my web folder but craft cant seem to find my folder? How do i make craft find the ...
0
votes
0answers
20 views

How to disable “show On Homepage” option from CP

I am created entry. That entry contains title and page content. And the title of the entry show on menu bar of my site. But I want some entry to not show in the menu bar. How can i do this?
0
votes
0answers
44 views

“Failed to instantiate component or class” when calling Craft module

I created a module with the pluginfactory generator. The module is used for generating a zip file with all the files belonging to a project. In the composer.json file, I added the following: "...
1
vote
1answer
23 views

Show error when normal user try to login in CP

when I login to my Craft CMS website via a normal user that user doesn't have permission to login to the Control Panel, it displays some error like HTTP 403 – Forbidden – yii\web\...
1
vote
1answer
33 views

Edit FreeForm lite from front end in Craft 3

I currently have a freeform which allows a user to register his/her information. I'm looking to build an edit page for each of these entry's so the user can come back and edit it if they've made a ...
1
vote
2answers
30 views

update via CLI with error!

I'm trying an update on the CLI and get the following error. If I do it again afterwards I get told that everything is up to date. If I want to install a plugin then I still get the message that I ...
0
votes
0answers
15 views

How to access controller method from a plugin script?

I have created a custom TwigParser which needs to execute some controller logic in a similar way to how CraftCMS's {% requirePermissionNode %} Twig parser does. Their implementation accesses the ...
0
votes
0answers
20 views

SCSS is not parsed in CSS using the SCSS plugin

I have a quick question about the SCSS plugin for Craft CMS I have successfully installed and activated it. Dependencies like leafo / scssphp are also installed. In the I have included the files: ...
0
votes
0answers
34 views

Craft CMS: Goes Unresponsive

I have an issue with the Craft3, after a few requests and clicking around the whole site (front-end and CP Admin) seems to hand and lag. Also I get a popup message on Google Chrome mentioning that ...
1
vote
0answers
16 views

Query element api (output) via plugin

Is there a way to fetch the content generated by the Element API via a plugin. For example, if we have created an ingredients/<slug:{slug}>.json endpoint, can the data for a specific page (eg ...
0
votes
0answers
13 views

Possible to move matrix content from one global set to another

Is it possible within the database to manipulate a couple of keys to move matrix content to another global set without having to re-enter it all in Craft 3? I have the matrix field in both global ...
0
votes
0answers
26 views

Category select field in custom plugin settings not saving

I am trying to show a list of categories on my plugin's settings page so an admin can select multiple categories. I am doing this with a Craft form macro: {{ forms.elementSelectField({ label: '...
2
votes
2answers
95 views

Running Craft updates

This is a newbie question regarding running Craft updates. In the past I've been caught out by stupidly running updates on the live server. I'm now trying to get into the habit of running the updates ...
0
votes
0answers
23 views

Shopify - Connect existing Element API/Vue JS site to new Shopify store

I have a Craft 3 site, currently running using the Element API and Vue JS as follows: VueJS: Product grid component ... mounted(){ this.getGridProducts() }, data() { return { ...
2
votes
1answer
52 views

Cannot access email section of settings

I somehow can't access the email section of settings; /admin/settings/email Argument 1 passed to craft\helpers\MailerHelper::createTransportAdapter() must be of the type string, null given, called in ...
1
vote
2answers
34 views

Best practice for year based paging

Is there a best practice for a paging based on the years of entries (instead of page numbers)? Example: I have 3 records with post dates 2019-01-01 2018-01-01 and 2016-01-01. So my paging should look ...
1
vote
1answer
35 views

How to query/filter by the value of a lightswitch

In my news entries, I have a lightswitch field with the handle 'pinned'. I'm trying to query my news section for both pinned and unpinned news entries (true or false essentially), but I can't get ...
1
vote
1answer
24 views

How to include a lightswitch for each related entry in the source element of a relationship

I have a Services section in which I keep a related entry field for News. (News by Service) The News items to be displayed for each service are selected in a "News" entries field in the Service entry. ...
1
vote
1answer
35 views

How to check for an non empty element field?

Which one of the following is the correct of way of checking if an element field like images, entries or category is not empty? {% if entry.fieldHandle.one() %} {% if entry.fieldHandle.all() %} {% if ...
1
vote
2answers
25 views

How do I iterate over a categories field in an entry

I'm using the Scout plugin to sync my entry data to an Algolia search index. In the transformer for the scout.php config file, I need to iterate over all of the categories in a category field on each ...
0
votes
0answers
29 views

How to tell whether a SuperTable column has data or is empty?

I have a "contact table" SuperTable with columns for Name, Phone, Email, and Website. In the template, I'm displaying the data as a table. I only want to generate table columns if a column has data. ...
0
votes
0answers
13 views

Upload Error: 403 Forbidden response with DigitalOcean

This is the error I get when uploading files through the front end and Craft admin into a docs folder on my DigitalOcean s3 instance (bucket name is changed to test). Error executing "ListObjects" on ...
1
vote
1answer
24 views

Front End Dropdown Field from Super Table

I have a single static Super Table Field with some Dropdown Fields. Is it possible to loop through the values instead of hardcoding each one? My hardcoded version works without problems but i think a ...
0
votes
0answers
22 views

Can't save fields

I want to change some fields and when I click 'save' it goes to the list of fields and the changes aren't saved. I can't add fields either. I can add and edit entries for example.
0
votes
0answers
11 views

Install of Craft 3 on Windows server gets 404 error on admin pages

I have tried installing Craft 3 onto a Windows 2016 server a few times and I've gotten the same issue where after an install I am redirected to the Admin page and have a 404 server error. I am using ...
1
vote
2answers
13 views

Why is category.getUrl() returning incorrect subdomain?

Forgive me if this is a server configuration or other issue unrelated to craft, but perhaps someone has some insight on what might be causing this, and how to fix it. When using a simple category....
0
votes
0answers
19 views

FeedMe Import Error: Can not create a node when the target node is new record

Trying to do an import using FeedMe. Earlier it was just a few entries are not created, getting the below error in the logs. i decided to start again, delete all entries and re-import, now no entry is ...
0
votes
0answers
21 views

Database Query in debugger consistently showing over 2000ms

In trying to optimize my Craft 3 site, I have discovered that it's apparently taking longer than expected to query my database. The duration for the apparent culprit is typically between 1900 and ...
1
vote
1answer
15 views

FeedMe - Import to multi language sites, linking entries

How does one use FeedMe to import content to a multi language setup? I can have one feed with all languages, or a feed for each language, but I cannot see how to set the locale of the import content, ...
0
votes
0answers
11 views

How to save a Neo block content with Super table block content

I'm using Neo blocks as part of an import process and I'm struggling to figure out how to do this via PHP. The following code snippet (a standard approach of setting the field value with an array ...
1
vote
1answer
24 views

Typogrify Plugin - Spaces getting removed?

We noticed that some of the text wrapped in the Typogrify plugin has spaces removed and gets bunched up. Removing the Typogrify filter fixes the issue but we are keen to retain the filters for the ...
0
votes
0answers
7 views

Update the element selection in BaseElementSelectInput via Javascript

I am building a javascript helper to assist user to populate some Entry/Category data. For the BaseElementSelectInput widget used in Entry/Category field when editing an entry, is there any way to ...
0
votes
0answers
20 views

Custom field value doesn't get saved

I have the following code: $fieldHandle = 'contentLead'; $entryTitle = $event->element; $entryQuery = \craft\elements\Entry::find(); $entries = $entryQuery->title($entryTitle)->limit(1); ...