Stack Exchange Network

Stack Exchange network consists of 174 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.

1
vote
1answer
10 views

Craft 3 Module Working but Throwing Errors in web.log

I'm seeing a lot of "Invalid argument" errors in the web.log for a "Multiple Option Variant" module I have running. It seems to be working just fine on the site, but curious as to what the issue might ...
1
vote
1answer
7 views

Create several subcategories without using the GUI in craft

I have to create the following categories hierachically : One book has between 1 and 150 chapters. I have to do this for several books. Dealing with chapters is painful using the GUI. Is there any ...
0
votes
0answers
8 views

Weighted Search Plugin Excerpt Not Loading

I am using the Weighted Search plugin on Craft 3. Everything works except the excerpt does not load. My code is below. {% set query = craft.request.getParam('searchQuery') %} {% set results = ...
1
vote
1answer
18 views

Removing the LivePreview and Share Buttons?

Is there a way to deactivate this functionality? We dont want our clients to use it just yet. I could delete them with my Module's js, but it is triggered after the site is build and the "popping" ...
1
vote
1answer
8 views

Craft install failed with error php7 not found, but server has php 7 installed

I'm trying to install a backup from production site which is running craft 3.0.26 to a UAT site. While installing, faced an error regarding PHP versions. Since both the sites are in the same server, ...
1
vote
0answers
11 views

Unable to add data via migration to a new field

When I am creating a new field (and I've tried plain text, redactor, supertable and matrix field) and associating it with an existing entry type (using the Control Panel to do so), I run into an issue ...
0
votes
0answers
26 views

Craft 3: Restrict access to Element API

I'd like to find out what the best approach is to harden the API and restricting access to it. I currently use: <?php use Craft; use craft\elements\Entry; use craft\helpers\UrlHelper; function ...
1
vote
1answer
23 views

Craft 3 large log file sizes

I've noticed that Craft 3 log files in storage/logs e.g. web-404s.log and web.log don't seem to have a max size or rotate like with Craft 2. The web-404s.log file is nearly 10 megs for 1 site now. ...
1
vote
1answer
18 views

Filter by category and update URL

This may be a simple question but I am not sure how to approach it - again trying to work out best practice for these things! I have a "single" at /our-work, which among other things displays a ...
1
vote
1answer
16 views

Craft 3 validate new password in change password

I'm trying to validate user's new password and confirm password in my custom plugin init(). Event::on(User::class, User::EVENT_BEFORE_SAVE, function(Event $event) { $formData = $_POST; $...
1
vote
1answer
21 views

Force redirect from HTTP to HTTPS via htaccess with multisite installation

I'm using Craft CMS 3 multisite installation with more than 20 website based on subdomains. There are websites: website.com one.website.com two.website.com with identical url paths but different ...
1
vote
1answer
30 views

White space added to start of template's

There is white space being added to the start of my templates. This isn't really an issue but because its happening to an RSS template that is breaking the feed and causing it to not validate. When ...
1
vote
1answer
22 views

Updating fails (except it does indeed update)

Updating Craft (and sometimes plugins like Commerce) through Craft 3 admin gives errors. Usually undefined, but have gotten "Backend fetch failed" most recently. Once I refresh the window, it seems to ...
1
vote
0answers
19 views

Product variant association

On my Products details page I have 2 selects. The 1st select list out the Primary variants. Based on the selected Primary variant the 2nd select is auto-completed in with Secondary variants that have ...
1
vote
1answer
14 views

Craft 3 query children of sub categories

Just wondering how to only query the children on subcategories. For example... Food ├── Fruit │ ├── Apples │ ├── Bananas │ └── Oranges └── Vegetables ├── Brussels sprouts ├── Carrots ...
1
vote
1answer
37 views

Craft 3 Element API Authentication/Login

First things first: This is quite similar to this, yet different. I'm trying to get authentication/login for Element-API for Craft 3 to work. Meaning I would like to restrict access to certain ...
1
vote
2answers
18 views

Nested category navigation

I am trying to achieve the following markup for my categories navigation: <h3><a href="categoryurl">Top Category One</a></h3> <ul> <li><a href="categoryurl"&...
1
vote
1answer
8 views

Getting a entry link created by current User

I am trying to create a link that would allow a logged in user to access their profile from the front end. Basically, the user has one page they can edit from the front end when logged in, and I'd ...
1
vote
1answer
51 views

Incorrect user-level lock name - Local Vagrant Environment - Craft 3

When creating a new field, I received a Database Exception error - SQLSTATE[42000]: Syntax error or access violation: 3057 Incorrect user-level lock name '/var/www/storage/runtime/compiled_classes/...
1
vote
2answers
24 views

Craft 3 protecting a page with a password?

I have used the Guest Entries to create a plugin where anonymous users can create a entry. I have a password field on each entry. Now I want the guests who have created the entry to be able to login ...
0
votes
0answers
20 views

How to save a file to an asset folder from the frontend?

I have a frontend canvas element that users can draw on that outputs as an SVG. If the users clicks a share button I want to save that SVG to an asset folder to then display a collection of all the ...
0
votes
0answers
16 views

Why S3 plugin on Craft 3 does not allow css [closed]

When I try to upload a CSS using Craft web UI using Amazon S3 plugin, I get an error that file type not allowed. If I use a third party tool to upload a CSS file on my S3 bucket, Craft refuses to ...
0
votes
0answers
13 views

Craft CMS 3 - Can Login Using Chrome - Cannot Login using Firefox

deployed this website on a shared Hosting and: 1) Can Login Using Chrome 69.0.3497.100 (Build ufficiale) (a 64 bit) EVERYTHING WORKS exexpt for An unknown error occurred. when saving entries (get ...
1
vote
2answers
37 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-...
1
vote
1answer
10 views

User Account Form Dropdown

I have a Countries dropdown menu for signing up that i didn't have before. It used to just be a text field where they can input their own country. It works on the front end sign up form properly, but ...
1
vote
1answer
17 views

Craft 3 Multi Site - Have a related entries field relate to another site, but respect localization

I am trying build a hub of sorts using Craft 3. I want the main site to be the hub which manages most of the data, and then subsequent sites are built on top of that, relating where necessary so as to ...
1
vote
0answers
18 views

Add custom column to the orders list page

Does anybody know if it is possible to add a column to the orders list page? I can choose the 'Foo' label, but when the page want to show the orders list I get the following error: "{"error":"An ...
1
vote
1answer
18 views

Is there a way to allow users to control alignment of images in the Redactor plugin using Craft 3

I'm looking to let editors determine the alignment of images in a Redactor field. I wasn't sure if it worked out of the box with Craft 3 (I'm using 3.0.9). I did find this plugin: https://github....
1
vote
1answer
16 views

Push/Add asset to Entry by asset filename

I have spreadsheet that i'm parsing and I have available to me a Entry ID and the Asset filename. Can I add the asset to the entry by the filename? Im targeting the product entry with: $product = ...
1
vote
0answers
27 views

Craft 3 language switcher with same domain

Is it possible to create a multi language website in same domain? In the admin settings, I created a second site with the same domain, but with a different site language. templates/ ├── index.twig ...
1
vote
1answer
11 views

API - Update Asset Volume

Im trying to figure out how to move asset(s) to a different volume. Also if I move it will that affect the entries that are using the asset? Here's what im using to target the asset: $resourceImage = ...
2
votes
1answer
17 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 ...
1
vote
1answer
19 views

Craft redirects to domain.tld/domain.tld/ on logout

I have a logout button on my site that points to the logoutUrl. While the logout works and ends the user session, the user is brought to a page with the URL similar to domain.tld/domain.tld/ where ...
1
vote
1answer
22 views

Allow users to edit user account email from front end form in Craft 3?

Is there a way to allow users to edit their email address via a front-end form in Craft 3? My understanding is this would require an 'elevated' user session. Which I'm guessing can only be achieved ...
1
vote
2answers
25 views

Filtering by categories AND tags with full match

We're trying to filter by categories AND tags in the one form. However can't seem to get things working as we would like. Essentially, we have a form that pulls in the tags and allows multiple ...
1
vote
0answers
35 views

How can I edit multiple entries via multiple front-end forms using Vue.js?

I found this post. However, writing a plugin in currently not an option, and I'd like to do this with Vue.js since I'm already using it for form validation & other stuff. Also, this involves ...
1
vote
1answer
23 views

Translate labels in CP with Craft CMS 3

I was wondering if it was possible to translate the labels, like "Singles","Entries" in the CP I know it's possible with Craft 2, but I didn't find with Craft 3. Do you have any ideas? Thanks!
0
votes
0answers
13 views

Get to get all users with active Commerce 2 subscription

How do I get all the users with an active subscription in Commerce 2? I want to be able to filter entries by subscribed users.
1
vote
1answer
54 views

Eager loading on entry not reducing queries

Using this snippet returns me 38 queries on my homepage without the Eager Beaver plugin. {% do craft.app.elements.eagerLoadElements( className(entry), [entry], ['headerImage', 'image1', '...
0
votes
0answers
16 views

PHP Warning – yii\base\ErrorException

I have to install craft 3 and run an installer. but php warning error occurs: mb_strtolower(): Unknown encoding C:\xampp\htdocs\php\crademo\vendor\craftcms\cms\src\helpers\StringHelper.php at line ...
0
votes
2answers
32 views

Use Imager plugin with Element API?

I'm trying to use the Imager-Craft plugin to make specific image transformations, but cannot figure out how to access Imager within the element-api.php file. Imager shows plenty of template examples, ...
1
vote
2answers
29 views

How can I change CP language in Craft 3 after installation?

I saw how I can change system language (CP) after installation in Craft 2, but I can't find how to do it in Craft 3.
0
votes
0answers
26 views

Redactor customisation not showing in Redactor text field

I've set up a custom redactor .json file which works and shows up on the dropdown, however, whenever I'm selecting one of the options the text in the field isn't updating to the chosen style. I've ...
1
vote
1answer
29 views

How can I list Entry Types of a single Section?

The following outputs all sections and their entry types, but I'm struggling to work out how I output only the entry types from the "blog" section. {% for section in craft.app.sections.allSections() %...
1
vote
1answer
29 views

403 Error on homepage of second language

We are trying to setup a second language. We've gone through the steps and created a second website, we defined the base URL as @web/de for the second language (German). The deeper sections are ...
0
votes
1answer
16 views

Imagemanager plugin doesn't show up in toolbar

I have upgraded redactor 2 to redactor 3, since a lot of things had to be changed. Been fixing those and it works well. I have a problem with image manager plugin which doesn't show up in the toolbar. ...
0
votes
2answers
29 views

What files need to be moved for Craft3 plugins?

I'm trying to get the redactor onto my site. I've successfully moved over plugins from the store and a custom plugin I created. But I did those towards the start and had migrated the entire project ...
0
votes
1answer
24 views

Craft3 DevMode doesn't turn off

I've been working on a site locally in devMode. I moved it from Craft2 to Craft3. I set devMode to false in config/general file and in admin it doesn't show the devMode bar uptop, but everything in ...
0
votes
1answer
23 views

craft 3 request

Can someone point me to the craft 3 docs where I can find informations about the request template function: craft.app.request.getSegment(2) I'm really struggling understanding the craft cms 3 docs.....
0
votes
0answers
24 views

Custom plugin: asset fieldtype

I have a custom plugin that uses a custom field leveraging the elementSelect fieldtype to select an asset (which is then processed on submission via a custom service). However, when I select an asset ...