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
3
votes
1answer
143 views

Install instructions

I'm having difficulties following the install instructions found at https://docs.craftcms.com/v3/installation.html. I've ssh'd into my server, and I'm running composer to install Craft, as directed in ...
3
votes
2answers
83 views

Entry Tracker to see who has completed the course

I'm working on a project using Craft CMS for the first time, so far so good, however i'm stumped on how to do the following: Create a button on each entry in a structure that states you have read the ...
3
votes
2answers
102 views

Switching plugin license from Craft 2 to Craft 3

Dumb question, but... I purchased a plugin when using Craft 2 and now I'm trying to input the license for it in Craft 3. There's an input for the license key when I go to settings -> plugins, but the ...
3
votes
1answer
556 views

Craft 3 Element API: Query the “parent” entry of a “child” entry with Matrix blocks connected by an 'Entries' field

In a Matrix block field of a "page" entry, I'm using an Entries field to manually select a list of "article" entries to the "page" entry. When I query an "article" entry, is it possible to query its "...
3
votes
1answer
235 views

Check if a field a included in a Matrix block

Situation: I have a matrix with about 10 block types, 3 of which have a certain field. I want to check if the current block has that field. The field in question is a dropdown with values in all 3 ...
3
votes
1answer
214 views

What is the proper way to set `currentSite` in a CP template when managing multi-site stuff in Craft 3?

In some of our plugins, we have added multi-site support. For the most part, things are working fine but I'm feeling a bit confused about the correct way to set the currentSite in the Control Panel. ...
3
votes
1answer
94 views

Preserve formatting when exporting from Wordpress

I'm using the WP All Export plugin to get posts out of Wordpress, and Feed Me to import to Craft 3. Problem I'm having is I can get a great XML feed out of the WP All Export plugin, but post "Content" ...
3
votes
1answer
1k views

Example of Craft 3.0 plugin - querying an existing table

Learning how to create plugins. I want to do a select query in an existing table in the Craft database, build navigation HTML and then return that HTML using a variable. I can see how to set up my own ...
3
votes
1answer
1k views

Auto enable/install plugin through config

Is it possible to auto enable/install a plugin through config (or another way) rather than having to do this through the database?
3
votes
1answer
3k views

How to route to a controller action in Craft3?

Before I get tagged as a duplicate I have already tried everything in the 'duplicate' issues on here to no avail so I'm posting my exact config to see what I'm doing wrong. Here is my plugin code and ...
3
votes
1answer
850 views

How to get section content from another site with multisite setting

I have a multisite on Craft 3 and I was wondering how to get section content from another site? Let's say I'm on a default site and I want to get contact content from site with handle siteA? Can this ...
3
votes
1answer
178 views

How to limit Expanded Search (plugin) query results for pagination?

I'm using the Expanded Search plugin to display results of the search query with an excerpt of the text matching the query for each result. I want to limit the results to 10 per page, using pagination....
3
votes
1answer
193 views

Selling tickets to repeating events with Commerce (and Solspace Calendar?)

We need to build a ticketing system for venue tours, that happen every week within certain date ranges, and with an option to exclude specific dates from the availability list. Looking at Solspace ...
3
votes
1answer
268 views

How should one go about using Craft with Git? [not duplicate]

I've seen many other questions about Craft deployment, some of which even use Git, but none seem to thoroughly address how one would use version control on their local development environment, push ...
3
votes
1answer
145 views

Updating matrix field from font-end with $entry->setFieldValue() pulls in Cp bundle on save

I have an entry with a matrix field which I'm updating from front-end. The update works fine, but when the (font-end) page reloads after submitting the form, the CP bundle assets get included (...
3
votes
1answer
325 views

Impossible to invoke a method (“limit”) on an array

I recently upgraded a site from Craft 2 to Craft 3, so I'm trying to figure out what was deprecated and caused this error. At the top of the page I have this {% set solutions = craft.entries....
3
votes
1answer
183 views

Why is Sprout Forms returning 302 for ajax requests?

I am using Sprout Forms on a Craft 3 site and trying to submit my form via ajax. I've been able to do this many times in Craft 2, but not having much luck with 3 (yet). The docs look mainly for Craft ...
3
votes
2answers
481 views

Craft 3 User Registration form errors not showing for custom fields

I've built a front end user registration form and everything is working well with it except that it's not showing errors for my custom fields. They're set as required in the CP, but the form submits ...
3
votes
2answers
893 views

Craft 3.0 - Recommended development environment for Windows?

I was wondering what people who are developing on Windows 10 are using as webserver environment in 2018? I have had ok results previously using ampps, but I'm having a lot of problems with Craft 3.0 ...
3
votes
1answer
1k views

Element API display entries by category

With v2 of the Element API plugin, I'm having issues with working out how to return entries that are in a particular category. I've got the slug in the API route but can't work out what the query ...
3
votes
2answers
1k views

Craft 3: multisite and assets

I am a little bit confused by the documentation about assets. It says that paths are relatives from the directory that holds the index.php file. Now, I am working on multisite, with the following ...
3
votes
2answers
3k views

Craft 3 Plugin Routing Problems

So I am working on converting a previously-standalone Yii 2 app into a Craft module and am having some issues with routing. I wish to keep my old URL structure as much as possible. As such, I ...
3
votes
1answer
56 views

Can someone explain to me the difference between 'not' and without?

Here is an example of code I'm trying to use to eliminating have to iterate comparing the current entry.title to the related to entry.title then omitting it. {% set entries = craft.entries.relatedTo(...
3
votes
1answer
67 views

Obtain suspended users in Craft3 Dev Preview

So I'm running into an issue where I'm given the users email. From there, I use the following code: Craft::$app->getUsers()->getUserByEmail($email);. This returns a null value, not because the ...
3
votes
1answer
451 views

Multi sites: should I use Craft 2 locales, or go with Craft 3 alpha?

I have a couple of imminent projects that will need some type of multi-site support. One is a large project that will need to share data between at least 3 sites. Where data is entered in one site and ...
3
votes
1answer
52 views

Using multiple elementTypes in Element API

I am currently trying to create an autocomplete search with the element-api. I need results from two different elementTypes: Product::class Entry::class How do I get results out of both elementTypes ...
3
votes
1answer
265 views

Element query: find entries where a field's value is greater than, or less than another field's value?

I would like to do something like this: craft.entries.section('mySection').field1('> field2').all() And it should return all the entries in mySection whose field1 value is greater than their ...
3
votes
1answer
863 views

Plugin service and variable

I have a service called useTR.php. It has a public method exampleService(). In the variables folder I have added the following code in my KGVariable.php (KG is my plugin name) public function ...
3
votes
1answer
413 views

Attempting Craft 2 -> 3 Upgrade | An Error occurred while handling another error

I'm trying to upgrade Craft 2 -> 3. I can install Craft 3 no problem, but when I try starting over/upgrading I'm hitting this error. The Craft 2 site is running the latest version of Craft. MacOS ...
3
votes
1answer
522 views

500 Error with no details on site migration

I'm trying to migrate my site from a PHP5.6 host to a PHP 7 host in preparation for Craft 3. I've copied everything across and am trying to load an exact copy of the production site on a different ...
3
votes
0answers
187 views

Search weighting

Is there a way to control the weighting of certain fields in Craft when using search in the front-end? I have a Products Channel which I am trying to search against and I want to be able to boost ...
3
votes
0answers
419 views

Autocomplete for Visual Studio Code for plugin development

How to achieve autocompletion for Craft 3 for PHP inside Visual Studio Code? I mean, what is required (like installing PHP locally, folder structure etc.) if at all possible? I assume many people who ...
3
votes
0answers
336 views

Mailer config in Craft 3 not getting merged

I have this custom config in config/app.php, but Craft seems to keep using the default Control panel Sendmail config. It seems this doesn't get merged in the main.php file. (as promised) return [ '...
2
votes
4answers
4k views

Install Craft 3 on Web Server

I scoured the the web to the ends of earth and couldn't find any info on how to install Craft 3 on my VPS. The package I downloaded is unconventional in many ways. Any ideas how to get Craft running? ...
2
votes
4answers
3k views

How can I troubleshoot why my queue of tasks in stuck in Craft 3?

I have a series of tasks lined up in the queue to run but they are just marking one as in progress and then sitting there and not executing. I have tried updating the DB table "queue" by doing the ...
2
votes
3answers
2k views

Loop through all sites in multisite installation

Who knows how to loop through all sites in multisite installation? I want to create kind of drop down menu to switch between websites. I've found this code inside the backend template but looks like ...
2
votes
4answers
219 views

Excluding an include template

is there a simple way to exclude an 'include' for specific pages? For instance I have an include {% include "_globals/_footer" %} but I don't want it to appear on my contact and 404 pages. How ...
2
votes
2answers
474 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 ...
2
votes
2answers
749 views

URI for nested categories in Craft 3

I am trying to set up the URIs for some nested categories in Craft 3 but am having some issues. My structure is basically: service-one |-subservice-one-a |-subservice-one-b service-two |-subservice-...
2
votes
4answers
1k views

Breadcrumbs for Craft 3

How do you make breadcrumbs in your Twig templates for Craft 3? Unfortunately I found examples only for Craft 2
2
votes
2answers
761 views

Nested Entries in Craft 3

In Craft 2 there used to be a Nested Entries field, but this is not available in Craft 3. I know I can do {parent.uri}/{slug} in the Entry URI Format field, but if I want it to be appended by ...
2
votes
2answers
693 views

“Request missing required body param” error when creating entry on front end

I get an Request missing required body param error when trying to create a new entry on the front end. All required fields are being filled. Nothing changed except the craft version. Craft version is ...
2
votes
2answers
600 views

Craft 3: Preventing Element from Saving in Plugin

I had a simple Password Confirmation validation function in Craft 2. In porting the function to Craft 3, I'm struggling to figure out how to handle the same thing. In Craft 2, all events were ...
2
votes
2answers
370 views

Accessing Multiple Databases in Craft

Is there a way to access another database outside of the one Craft uses for its content? I need to able to access data fields from an external source for a project I'm working on.
2
votes
2answers
305 views

Still not able to manage tags in Craft 3?

I have page where I display some items and there are filters by tag. So I make a list of all tags that are created. Then when the user click on some of the tag, he see only the product with that tag. ...
2
votes
2answers
1k views

Craft 3 multisite - are entries accessible between sites?

In multi-site is it possible to access entries between sites in the templates. Like a feed? ie. entry "a" on site "A" shows up in an index on site "B", and links back to the entry on site A, not a ...
2
votes
1answer
571 views

Register multiple TwigExtensions in one plugin in Craft 3

In my plugins init() function I have this: Craft::$app->view->registerTwigExtension(new TestTwigExtension()); If I duplicate that and change the Twig Extension class name, I just get an error:...
2
votes
2answers
3k views

Craft 3 - ajax request to plugin

This is a pretty simple test before I implement some larger functionality. Eventually this will be just a glorified upload form via ajax. Part 1 - Ajax post $.ajax({ type: 'POST', ...
2
votes
2answers
543 views

Grouping entries by title in Craft 3

I need to group a set of entries alphabetically and I don't get a working and clean solution. Taking this documentation entry, I am doing it as follows: {% set fromAtoF = craft.entries.section('...
2
votes
1answer
2k views

Craft 3: Update database after CMS upgrade via console command

Is there any craft command command (shell) which can be used to perform the database updates necessary after a CMS update? (e.g. Craft3 beta-28 to beta29 or multi version updates) Background: We are ...

1 2
3
4 5
32