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
0 votes
1 answer
312 views

Craft 3: Cache element query or variable assignment

Is it possible to cache a variable assignment and/or an element query with TWIG in Craft 3? With Yii2 this is possible, but is there a wrapper to TWIG? 2 use cases: {% set entries = craft.entries....
user avatar
1 vote
1 answer
285 views

Craft 3: Get missing translations

Is there an easy way in Craft 3 to get all missing translations for a certain language after they were piped through the translate TWIG filter? {{ 'translate this text' | t }}
user avatar
2 votes
1 answer
799 views

Craft 3: .find() deprecated but .all() fails?

.find has been deprecated and we are told to use .all() instead. This seems to work for cases that don't have Eager Loading going on, but fails when eager loading is tried. My working Craft 2 code ...
user avatar
  • 3,084
1 vote
1 answer
393 views

Craft 3 forgets plugins

Due to problems I had with Craft 3 Beta 23 I switched back to version Beta 22 (I did this a couple of times) I do this by importing an sql dump of beta 22 and by directly requesting Beta 22 via ...
user avatar
2 votes
1 answer
769 views

Craft 3: How to get Volume by handle?

How can I get the details of an asset volume in Craft 3, if I only know the handle? I found the Volumes and the Assets service, but I believe none of them provides a method for that purpose. The only ...
user avatar
1 vote
1 answer
1k views

Create Craft 3 Plugin - Call to a member function getVersion() on null

I'm trying to write my own Craft 3 TWIG filter / functions. For this purpose I created a scaffolding using pluginfactory.io. I did a composer require and composer correctly symlinks the plugin to the ...
user avatar
1 vote
1 answer
103 views

get entries randomly every minutes?

I want to get entries randomly every minutes like setTimeout in javascript. Like below If possible. setTimeout({ {% for entry in craft.entries.section('alumni').order('RAND()').limit(6)....
user avatar
2 votes
1 answer
502 views

Craft 3: query matrixBlocks and eager load its owner?

Does anybody know if it's possible to load matrixBlock and eager load the entries (=owner) the matrixBlocks belong to in Craft 3? I tried: {% set blocks = craft.matrixBlocks.type('eventDate')....
user avatar
1 vote
1 answer
1k views

Craft 3 Multi Site - Entries/categories/assets fields aren't translatable?

I'm testing out the Craft 3 beta's multi-site capability at the moment to see if it's suitable for an upcoming project. My sample scenario is a school that runs out of multiple countries. They offer ...
user avatar
  • 917
7 votes
2 answers
2k views

How do I upload an asset in Craft 3, via PHP

I've found various answers on how to upload assets via PHP for Craft 2, however nothing for Craft 3. All answers use the method: craft()->assets->insertFileByLocalPath() E.g: How to upload an ...
user avatar
1 vote
1 answer
3k views

How to save a new entry with custom fields - Craft 3

I'm trying to create a new Entry via PHP, with custom fields (Craft 3). I can save it, however my custom fields don't appear. I've tried using setFieldValue, as well as $entry->excerpt = 'Lorem...';...
user avatar
1 vote
0 answers
185 views

Craft 3 improvements to relationship querying?

I've been using Craft for a couple of years now and I do love it, however I consistently run into massive performance issues with it. I heavily rely on caching and eager loading - however this doesn't ...
user avatar
  • 917
2 votes
1 answer
2k 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 ...
user avatar
1 vote
1 answer
1k views

PHP version issue when installing Craft 3 using Composer

Why do I get the error when I try to install Craft 3? composer create-project craftcms/craft Documents/Development/Project -s beta The error: [InvalidArgumentException] ...
user avatar
  • 153
8 votes
2 answers
4k views

How to link to controller actions in a Craft 3 plugin?

I cannot find any documentation that specifies how to link to controller actions which return a rendered template in CP. Let's say I have a plugin called waffles and my namespace is Very\Waffles. I ...
user avatar
  • 396
1 vote
1 answer
147 views

Plugin settings per site/locale

I'm trying to make a plugin in Craft 3 but want it to be possible to set different settings for each separate site or locale. How would I go about doing this?
user avatar
  • 171
1 vote
1 answer
2k views

Craft CMS login 500 (Internal Server Error)

I transferred a website using Craft CMS and now when I want login to admin the console return me jquery-2.2.1.min.js?d=1493126871:4 POST http://website.com/index.php/admin/actions/users/login 500 (...
user avatar
  • 11
1 vote
1 answer
765 views

Commerce plugin in Craft 3?

I am looking at Craft Commerce (https://craftcommerce.com/) and I am wondering if anyone has any experience using this in Craft 3? Seems like it is only for 2.x for now. I am struggling to find any ...
user avatar
  • 63
4 votes
0 answers
844 views

How to handle Craft 3 events in a plugin? Element API is returning null data

The below refers to Craft 3 and the Element API plugin for Craft 3. I would like to do something when the Element API plugin fires its onBeforeSendData event, I can see in the controller for element ...
user avatar
5 votes
3 answers
1k views

Private plugin distribution in Craft CMS 3

what is the best way to install private plugin in Craft CMS 3? The private plugin is installed in private GitHub repo, but we don't have a custom packagist that we would use, therefore I wonder if ...
user avatar
8 votes
5 answers
3k views

Has someone figured out Craft 3 content migrations?

One of the big features for craft 3 is content migrations. Migrating fields and sections between environments (like deploying code to test or production). I'm just having a hard time figuring out what ...
user avatar
  • 148
2 votes
4 answers
271 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 ...
user avatar
  • 132
7 votes
3 answers
5k views

Multi-site setup in Craft3

Hi guys are the any more detailed tutorials on how to setup a multi site on Craft3 BETA? I created two sites now, a Danish and English through the admin (Settings → Sites). The domain is the same but ...
user avatar
3 votes
1 answer
559 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 ...
user avatar
2 votes
3 answers
792 views

Craft 3 Call Own Service

I created a plugin for Craft 3 at pluginfactory.io. I want to call it in my template variable public function exampleVariable() { // hint AdminBar::$plugin->editLinks->exampleService() ...
user avatar
5 votes
3 answers
4k views

Setting the Homepage URL in Craft 3

This seems like an odd question, but I've looked through the documentation, Slack, and the StackExchange and it's weird that I'm not seeing anything... so I feel like I'm overcomplicating it. How do ...
user avatar
  • 1,022
1 vote
0 answers
453 views

Retrieving custom settings in Craft 3 plugin [closed]

I'm trying to retrieve the settings that a user sets in a Craft 3 plugin. The method I used in Craft 2 plugins doesn't seem to work anymore. To demonstrate the problem, I'd made a plugin and uploaded ...
user avatar
2 votes
1 answer
1k 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 ...
user avatar
  • 176
3 votes
1 answer
58 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(...
user avatar
3 votes
1 answer
87 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 ...
user avatar
1 vote
3 answers
327 views

Obfuscating email set by global variable

Is there a way to obfuscate an email address link that's generated by a global variable? I tried using Sprout's Encode Email, but it doesn't seem to work with an email address I've generated by a ...
user avatar
  • 11
3 votes
1 answer
459 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 ...
user avatar
  • 611
9 votes
3 answers
1k views

New Project: Wait for Craft 3 or start now with Craft 2?

I am just about to start a new project and Craft seems the best fit as a CMS. The projects timescale is 3 months. I understand that a beta for Craft 3 is due out at the end of this year (2016). In ...
user avatar
1 vote
1 answer
510 views

Craft 3 doesn't see my Commerce plugin

I am running a local install of Craft 3 Pro dev preview using MAMP and Sequel Pro on my iMac. I downloaded the Commerce plugin to try it out and dropped the 'commerce' folder into my craft/plugins ...
user avatar
  • 11
4 votes
2 answers
320 views

How long will it take Pixel and Tonic to release Craft 3?

I am just wondering, when will Pixel and Tonic release Craft 3 stable version?
user avatar
  • 227
1 vote
3 answers
657 views

Local install does not start, PDO Exception

I wanted to install a single instance of craft on my local machine. However upon starting the installation via calling /admin/ or /admin/install, the only message I get, is SQLSTATE[3D000]: Invalid ...
user avatar
0 votes
1 answer
428 views

I can't add a body field?

I have made a new "section" called Blog. In the dashboard I now have a quick post panel but I can only input a title and nothing else? How can I add the ability to have a body etc?
user avatar
1 vote
1 answer
751 views

400 error on Craft 3 installation

When I try to install Craft CMS 3 by going to /admin the site redirects me to /index.php?p=admin/install where the Begin button shows. Clicking next send me to the screen to create an admin user. ...
user avatar
  • 11
1 vote
1 answer
613 views

CraftCMS 3 - Composer Update

How can I update all the packages under craft/app/vendor for Craft CMS 3 (Yii 2)?
user avatar
  • 131
0 votes
1 answer
114 views

How to limit selected items that appear on special page

I have a client that wants to select "featured" entries to appear on their home page, and in a specific order that they can set and change. My initial idea was to set up a featured check box and just ...
user avatar
0 votes
1 answer
79 views

sendEmail messages not being received by Exchange server

I've been able to get this to work with my gmail address but not my work's Exchange email account. How can I make this receivable by exchange mail servers? $email = new EmailModel(); $email-&...
user avatar
  • 183
1 vote
1 answer
271 views

How to grab all images from and section

I am sure this must be answered somewhere and I cannot find it. I need to grab all images from a section (channel) and display them in a slide show on the index page (index page is a single,so index ...
user avatar
5 votes
0 answers
386 views

How to load components into Craft 3 plugin?

what is the correct way to load third-party components into Craft 3 plugin I'm developing? I tried adding $this->setComponents([ 'authClientCollection' => [ 'class' => '\yii\...
user avatar
5 votes
1 answer
2k views

Unable to locate message source for category ''

I'm trying to update my plugin to Craft 3 and I'm getting this error message: Unable to locate message source for category ''. What does it mean?!
user avatar
  • 13.3k
16 votes
2 answers
2k views

Are there any plugins for Craft 3?

Are there any Craft 3 plugins yet? They would be useful as examples for porting/writing other Craft 3 plugins.
8 votes
5 answers
3k views

How do you set a user's group on a registration form?

In a registration form with public signup possible, how do you set the user group for a particular form? As a stop-gap I am attempting to use the following code: function init() { craft()->on(...
user avatar
  • 6,682

1
33 34 35 36
37