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
0answers
5 views

Filtering Entries based on Amenities (Category)

Hello and thank you in advance. I have a page that lists hotels by region. On the initial load of the page I am able to render all the hotels by region in a tabbed format. This part of the page works ...
1
vote
1answer
6 views

How to import entries from Craft 2 to Craft 3?

So, I've been working on a Craft 3 upgrade, managed to set everything up, including configuring new plugins etc. Since I've started working on the upgrade process, some new entries have been published ...
1
vote
1answer
12 views

How to get users with birthday today in plugin/module?

How does one retrieve users from Craft3 DB whose birthday is today? Birthdate field type is Date/Time. Have a working PHP/MySQL example, but unsure how to port this to Craft3 syntax. $sql = '...
1
vote
1answer
11 views

Can't get current entry's ID - Impossible to access an attribute (“id”) on a null variable

I'm trying to upgrade my website to Craft 3 and can't resolve one issue with this piece of code: {% for category in craft.categories.group('blogCategories').order('title') %} <li><a href="...
0
votes
0answers
31 views

Craft can’t connect to the database with the credentials in craft/config/db.php

I'm trying to upgrade from 2.7.10 to Craft 3. I follow the instructions/ docs to the letter, go to https://groomarts.com/admin and am greeted with the above can't connect to database message. So far,...
0
votes
1answer
20 views

Show 2 random entries based on checkbox in Super Table

I have a Super Table field (entryType) with a checkbox field "featuredIn" and some values. I can't figure out how to mix "slice" and "orderBy RAND" with filtering by that field. This shows me ...
1
vote
1answer
46 views

switch / rotate images based on device orientation (landscape / portrait)

I have the feeling I'm the only one with such complicated code for my images. With so many devices with different view ports and landscape / portrait... How do you all handle your picture tag art-...
0
votes
0answers
10 views

Product URL does not change after updating its related category slug

I have Commerce Products set to use the following Category URI structure: {relatedPage.first().uri}/{slug} What this does is, allow us to relate the Product to an Entry and take the entries URL ...
1
vote
1answer
25 views

Only Install migration is applying on plugin install

I have a custom plugin which is added via path repository on local. I have some migrations in the src folder. My problem is if I uninstall the plugin and install it again, I can see all of the ...
1
vote
1answer
15 views

Craft queue not being processed, listen not running

I built a site on a dev server and the Craft queue worked in that with no extra setup needed. In fact I installed Async Queue Manager because Crafts way was too slow. They both worked fine. I moved ...
1
vote
2answers
25 views

Creating / manage content - how is everybody doing it?

I need some ideas for creating content. It's a bit of a pain the way i have it now. I tested this: https://nystudio107.com/blog/creating-a-content-builder-in-craft-cms But i don't really like it ...
0
votes
1answer
5 views

Plugin RegisterUrlRulesEvent - cannot find Controller aciton -> 404

The error I'm getting: HTTP 404 – Not Found – yii\web\NotFoundHttpException Page not found. ↵ Caused by: Invalid Route – yii\base\InvalidRouteException Unable to resolve the request "Expedweather/...
1
vote
1answer
16 views

(content) Propagation + website in multiple languages

Currently we're developing a craft multi-site that has 3 languages (nl, fr, en). It's an upgrade (new style, removing junk, ..) from another cms so the content has to be inputted manually. We've ...
1
vote
1answer
17 views

Store phonetics in plain text field

I need to store phonetics for word definitions in a plain text field. An example would be something like "Craft Website" => \ ˈkraft ˈweb-ˌsīt \, like you'd see in a dictionary. If I try saving \ ...
1
vote
1answer
33 views

Disable activation link email for a specific user group

I am developing a website which is having two user groups. The users of first user group will have self activation email with account activation link while second user group will be activated by admin ...
1
vote
1answer
27 views

Craft on WSL permissions error

For anyone installing install Craft on WSL (Windows Services for Linux)... WSL has enough traction with developers that I decided to take the dive, but I'm having trouble getting permissions straight ...
1
vote
1answer
26 views

Importing Macros doesn't work

I'm trying to upgrade my website to Craft 3, so I've imported all template files and installed the necessary plugins, but I can't deal with one error. I've got a template named _layout.twig, and the ...
1
vote
1answer
17 views

Plugin RegisterUrlRulesEvent - Regex URL-Routing gives 404

I'm updating a Craft 2 plugin to Craft 3 and I'm having difficulties getting the Regex URLs working correctly. The eocs I'm using: Craft3 Docs I used pluginfactory.io to create the basic craft3 ...
0
votes
0answers
20 views

AWS Serialisation error on front end

Getting the following error on a site I'm developing: Instances of craft\awss3\S3Client cannot be serialized Unsure if this is an issue with the Amazon S3 plugin or at my bucket's end. Any ideas ...
1
vote
1answer
21 views

Craft CMS Project Config file override

Hi I am using Craft CMS with the project config file to keep various environments in sync. This generally works fine but I have run into an issue with plugin settings. I am using the Contact Forms ...
1
vote
0answers
35 views

Craft Commerce Adjuster API/PHP questions

I've got a module set up to add discounts based on criteria defined in a category group (handle 'productPacks') -> category (which is a "pack"). Now, everything works great for one type of pack, and ...
0
votes
0answers
5 views

Craft 3 Matrix Field customFields property 'required' and 'sortOrder' fields null

I'm trying to dynamically build a frontend form based on a Matrix field. I'm iterating over the entry.aMatrixField.customFields array which returns me an array of field objects in Twig. The field ...
1
vote
0answers
16 views

Webhooks: Filter Entry by type (or Section)

Using the Webhooks Plug-in, I'm looking to specify a "scope" (or filter) for content type (or section) when using the saveEntry event. Example: Fire a webhook only when a new entry of specific type (...
1
vote
2answers
49 views

Visitor-facing pages work; admin login doesn't--I can't login in to admin

The login page has no styling, including no Powered by image. This is what displays beneath the site's title: When I try to login I receive: Bad Request Unable to verify your data submission. The ...
0
votes
1answer
39 views

Craft 3: White blank page when accessing website and Craft login page

I'm getting white blank page when trying to access my website and Craft login page. I haven't updated the website for few months. So I assume no files has been changed. I checked with the hosting ...
0
votes
1answer
36 views

How-to display a dropdown field with optgroups?

The display of a dropdown without optgroups is defined: {% set field = craft.app.fields.getFieldByHandle('<FieldHandle>') %} <select name="fields[<FieldHandle>]"> {% for option ...
1
vote
1answer
39 views

Headless Craft CSRF

I have a site that is using Craft CMS headless and React. There are a few forms that need to post to controllers but I'm not sure how to set up the CSRF tokens and keep it secure. Can anyone advise ...
2
votes
1answer
58 views

How to build contact form from scratch (no plugin)

I want to build a simple contact form without plugin, i am new to craft cms coming from wordpress, how can i build a simple form that will be save on entries and will send an email.
0
votes
1answer
16 views

Developers or experts for Craft CMS V3 in Costa Rica

I am looking for a Craft CMS developer in Costa Rica to help us with occasional issues
0
votes
0answers
40 views

Payment gateways are not synced

Craft Solo : 3.1.25 Craft Commerce : Lite (2.1.12.1) I am trying to integrate it with Commerce Lite for a subscription plan. I Created 1 product at stripe account. Added stripe keys to my local ...
1
vote
1answer
25 views

How to calculate half, third, fourth?

I'm trying to calculate some image sizes for Imager. This works: {% set imageSizes = [{ height: imageHeight * 4}, { height: imageHeight * 3}, { height: imageHeight * 2}, { height: imageHeight}] %} ...
1
vote
2answers
23 views

Setting body ID from includes does not work

This is my _layouts/main.twig: <body {% if bodyId is defined %}id="{{ bodyId }}"{% endif %}> {% include '_layouts/header.twig' %} {% block main %} {% endblock %} </body> Then i ...
1
vote
1answer
18 views

Craft 3 CMS How to get all Channel Names/Titles

I am trying to retrieve all Channel sections' names/titles. This is snippet contains the troublesome part. {% set allSections = craft.entries.all() %} {% for section in allSections %} {% ...
1
vote
1answer
24 views

How can I change variant price in Craft Commerce 2 form

I want to add range field that will change price based on its value. How can I send updated price to the cart? Is there something easy like: {% set product = craft.products.one() %} {% set variant = ...
2
votes
1answer
28 views

Checking the link type from a LinkIt field returns the whole path

I'm doing a project in Craft 3, there are many types of links so I installed the LinkIt plugin. I'm facing problem with this because I didn't find a method to check link type. If I use {{ entry....
0
votes
0answers
17 views

Custom plugin - how to save settings featuring array?

I'm developing a custom plugin but hitting an issue when I want to save a settings that uses the multiSelect, checkboxSelect or checkboxGroup fields (essentially any field that saves values as an ...
1
vote
1answer
17 views

How to use checkboxes to filter categories on the front end?

i am trying to filter the various categories i have. Currently my url formats the following : www.site.com/news?cat=industry-news&cat=architecture-design I understand that i have to change this ...
1
vote
2answers
36 views

Element API - Order results by Category

Is there a way to order the Craft Element-API results by the category title? I'm just getting the error SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data The "...
0
votes
0answers
18 views

Database Exception – yii\db\Exception

I created a plaintext field called 'researchYear' that was add to a section called 'research'. I added a record to the section. I went back to the field, renamed it to 'researchDate' and made it a ...
1
vote
2answers
40 views

Deploying and syncing project.yaml

I have a Craft CMS site set up that deploys through TeamCity and am trying to set up a build step to auto run "./craft project-config/sync". I keep getting an error saying the file can't be found, I'...
1
vote
1answer
23 views

Element API - Markdown in JSON

I'm a little bit stuck using the Element API. I managed to get my JSON file going pretty easily which was great but I've reached a point where I want to include some formatted copy as it would be ...
1
vote
1answer
20 views

Element API: How to get entries up to a certain page?

I have a query that is pulling entries from a structure with elementsPerPage' => 3 If my pagination looks like this: Page 1: Entries: A, B, C Page 2: Entries: D, E, F Page 3: Entries: G, H, I ...
1
vote
2answers
22 views

Search question: dot (period) and partials

We have a job inventory where the jobs are being saved as entries. When searching against jobs by keyword we search against two fields: the title and a job description field. However we are ...
1
vote
1answer
36 views

How do I set up Craft 3 to web server in WAMP?

I'm very new to Craft CMS, and I certainly love this concept! However, I keep trying to run it locally onto my computer following the documentation here https://docs.craftcms.com/v3/installation.html ...
0
votes
0answers
23 views

Craft 3 Upgrade, getting 503 on one subdomain

I am trying to upgrade from craft 2 to craft 3 and having a 503 error problem on ONLY ONE of the sub-domains. we are running nginx on Ubuntu on this server. we have 2 sub domains (www.domain.com &...
1
vote
3answers
20 views

Show only top level categories assigned to an entry

Having a bit of a brainfart here... If hotspotCategory is my entry's categoryfield and that category group has nested categories, how do I return only the top level categories? {% set entryCats = ...
1
vote
1answer
24 views

New Install, Permission Errors With /storage

I've configured Apache vHosts on a local box and installed a Craft 3 website onto it. This new instance will serve as my "staging" environment for an upcoming website. I've installed with composer ...
1
vote
2answers
14 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 [ // ...
1
vote
1answer
21 views

Updating large database from Craft 2 > 3 via command line

I'm migrating a large Craft + Commerce site up to Craft 3. I've completed all the initial steps and get as far as the "To complete the update, some changes must be made to your database. Finish up" ...
1
vote
1answer
31 views

Matrix | Craft 3 Element API / Scout Plugin

I am trying to grab the contents a matrix field (Redactor). Here is the section of code I am struggling with: $bodyBlocks = []; foreach ($entry->getFieldValue('pageBuilder')->all() as $block){ ...