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
450 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
370 views

How do I prevent secrets beeing logged in the PHP error log?

Background: I'm running Craft Pro 3.1.19 on PHP 7.2.15 Craft CMS, by default, uses vlucas/phpdotenv to get the configuration (containing secrets / credentials and lots of other stuff) from .env ...
3
votes
1answer
168 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
528 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
323 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
501 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
273 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
2answers
757 views

How do you set a flash message in the template in Craft 3?

How does one set a flash message in the templates? I can't find any documentation about this, only for plugins or getting the message. My use-case is, I am checking if a user is allowed to access a ...
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
4answers
917 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
569 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
4answers
199 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
307 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
178 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
1answer
1k views

Is there a way to apply project.yaml changes on deployment?

Love the new new project config functionality, but if there are changes that need to be synchronised the site essentially goes down until the changes are applied manually. I wondered if anyone had a ...
2
votes
2answers
254 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
524 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
2answers
258 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
978 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
439 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
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
2answers
459 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
2answers
162 views

EVENT_AFTER_SAVE_ELEMENT triggered twice after saving an entry

I had this weird issue, not sure if that happens to you guys or not. I'm trying to catch the 'after entry is saved' event, using the following code in my custom module's init() function (The module's ...
2
votes
3answers
926 views

unserialize(): Error at offset 0 of 60695 bytes

Hey guys I am getting this error: unserialize(): Error at offset 0 of 60695 bytes when i push a backup of my local db to my staging environment. I am using craft 3. Any ideas? Clearing the /storage/...
2
votes
2answers
161 views

Craft Commerce 2.0.2 Shipping Rule Names & Descriptions—How?

I just noticed I had to update some templates after updating to the latest Commerce version (2.0.2). How does one go about getting the method's rule description? I currently have it set up to apply ...
2
votes
2answers
2k 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
1answer
1k views

How do translations work in Craft 3?

I currently have a Craft 2 site deployment with a translations folder and a en_gb.php translations file. I would be able to use expressions like this: {{"visualization"|t}} However, this does not ...
2
votes
2answers
84 views

Laravel Forge not honoring Craft 3 maxUploadFileSize config setting

I have a Craft 3 site deployed to a Digital Ocean droplet via Laravel Forge. I have the maxUploadFileSize set to 256B (268435456 in bytes) in my config/general.php like so: <?php return [ // ...
2
votes
2answers
515 views

Craft 3.1: value of craft/web/Application::getIsLive() must be of type boolean, null returned

I tried upgrading a Craft 3.0 installation to 3.1, and got the following error: "value of craft/web/Application::getIsLive() must be of type boolean, null returned" Has anyone else run into this? ...
2
votes
2answers
1k views

Craft 3 Plugins - Setting Template Path To Site Templates

In Craft 2, if you have a plugin that needs to load a view from the site templates directory, you could just go: # Set the template context to site templates. $path = craft()->path->...
2
votes
1answer
315 views

{% paginate %} Tag issue, no prevUrl / nextUrl Data

I have problem with the {% paginate%} tag. Setting: Craft CMS 3.0.18 Channel with 3 Entries -> handle "newsBlog" {% paginate craft.entries.section('newsBlog') as pageInfo, pageEntries %} When i ...
2
votes
1answer
480 views

What is the difference between the Translation Methods when creating a new site

I am creating a new multi-lingual site and the documentation does not explain the difference between the options in the translation method dropdown. What is different for each of these and when is it ...
2
votes
2answers
3k views

Craft 3: 500 Internal Server Error when trying to install on server

For the last 3 days i've been trying to install Craft CMS 3 on my server. I'm using 1&1 internet, have FTP uploaded all the files, changed the permissions for the folders and files to the right ...
2
votes
2answers
432 views

Visual editor for Craft 3

Client is coming from WP and is used to Elementor (https://elementor.com/). Can create own rows, columns, etc. in content. Is there a visual editor for Craft 3? Client hasn't specifically requested ...
2
votes
1answer
564 views

Showing A Flash Message On Admin Entries Listing (Craft 3)

I've written a plugin that imports a CSV and creates entries from that for a client. I'm wanting to redirect them to the entries listing page after (i.e. /admin/entries/tvListings) and show a flash ...
2
votes
1answer
2k views

How do you query entries by field values?

I need to arbitrarily query entries based on the values of various fields. For example, if I have an entry type called "Widgets" I can grab them like this: $widgets = Entry::find()->section('...
2
votes
2answers
1k views

Error on Craft 3 install

When attempting to install Craft 3 in OSX El Cap, I'm getting the following errors: Script @php craft setup/welcome handling the post-create-project-cmd event returned with error code 255 /Craft3/...
2
votes
1answer
1k 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 ...
2
votes
3answers
385 views

Including the category group in nested category URIs?

I've asked already about nested categories here, but I've just upgraded to Craft 3 and things seem to have changed a little. I have three top-level category groups: - Home - About - Funding Each of ...
2
votes
1answer
740 views

Git configuration for CraftCMS

Please excuse this newbie question (newbie to Git that is). I'm trying to set up my CraftCMS environments with Git and wonder about best practices and how others configure your repositories. In ...
2
votes
2answers
119 views

API access to Craft 3

Does anyone know if there is an API for CRAFT 3 where I can authenticate to and query (CRUD) all the elements (channels, etc.) I have created on it? Thanks.
2
votes
1answer
63 views

Payment currency not allowed

Craft 3.3.8 Commerce 2 Lite Version If I change the base currency from default(USD) to NZD or AU in the setting CP > Commerce > Store Settings > Payment Currencies and browse to /shop/ or ...
2
votes
2answers
106 views

Trouble parsing JSON with getBodyParams()

I'm trying to use getBodyParams() to parse a JSON posted to a module controller action from an API. The incoming headers have content-type set as application/json; charset=utf-8, and I've tested to ...
2
votes
1answer
227 views

Simple webshop solution (Craft Commerce)?

I am looking for a simple shopping solution for one of my customers. Since their website is already running with CraftCMS, I am looking if there is any integrated solution available. However, so far ...
2
votes
1answer
597 views

CSRF in “Headless” Applications

There are a number of answers here about how to send CSRF tokens along with AJAX requests, but I think my question is a little different. Please excuse the abstractness here: In a headless ...
2
votes
2answers
645 views

Craft 3 How to get custom user field values

I have following custom fields for users. favouriteEntries - 'entry' type field with multiple entries per user notificationPreference - Lightswitch field My plugin should email notifications to ...
2
votes
1answer
102 views

How do I differentiate between entries after merging an array?

I'm trying to plot entries from two different Solspace Calendars and an Entries section on one map, and use different markers for all types. Alll of the events are related to the current Entry through ...
2
votes
1answer
292 views

How to get the previous or next two entries

I have an entry which needs to display the previous two entries, and the next two. I see in the docs there's a nextSiblingOf method. That does nothing in a channel, and in a structure it will only ...
2
votes
1answer
450 views

Plugin Store install buttons are not visible

I'm just working on a dev site and my Plugin install buttons are gone. I'm not sure how long they've been gone either, I don't really know where to start to debug it. No errors in the console and I ...