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
13 views

Show asset field value when asset is disabled for the site

I have an asset field type called organisation which points to another entry. That entry can be disabled for the current site, but I want to display it regardless. In Craft 2 the below code worked, ...
0
votes
1answer
34 views

Adding more data to the “commerce/cart/update-cart” action [duplicate]

Is it possible to add additional data to the "commerce/cart/update-cart" callback? For instance, we want to include an Asset field so we can populate a cart modal with the item's image in one call? ...
0
votes
0answers
22 views

Subsites not found when running Craft 3 on shared hosting

On most shared hosting, you can't set the webroot. As an alternative, a rewriterule to the web folder can do this. Could be something like RewriteRule ^(.*)$ web/$1 [L]. This works on main sites in ...
0
votes
0answers
24 views

How to access Google Tag Manager cookies in Craft/Twig?

I am trying to access a cookie that was set with Google Tag manager. Is there anyway I can access the value? I tried craft.request.getCookie(name) but Craft or Twig isn't recognizing the cookie. Is ...
0
votes
0answers
7 views

Unable to create new category groups in plugin

So, I'm writing a plugin to assist with a content migration which will be creating new category groups. I'm able to successfully run the plugin, and what's strange is that the category group does get ...
0
votes
0answers
46 views

Combining env variables with strings in settings

I have a site with multiple subsites in the following structure: www.site.domain/subsite. To create multiple subsites, I'd consider setting a base url in the .env (for easy changes: localhost <> ...
0
votes
0answers
65 views

How to sync/propagate entry titles in a site group?

I have created several site groups, e.g. English, Spanish and German. Within these are several sites and the fields are to translate per group. So within Spanish for example, all the content is the ...
0
votes
0answers
12 views

Controller conflict?

We are running Freeform and Snaptcha on a site and having problems with submitting Freeform posts. Basically, the Freeform form is always submitted but the Snaptcha response always fails. This means ...
0
votes
0answers
89 views

Huge job queue, hundreds of pending jobs, queue increasing faster than is processed

How do I avoid building up a massive job queue or have them process quicker? I think it even stalled and I used a plugin called Queue Manager to try them again. I have approx. 300 in the queue now, ...
0
votes
1answer
36 views

Fatal PHP error upon installation

I attempted to install the newest version of Craft and received this error in my logs: PHP Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\craft-cms\vendor\yiisoft\yii2\...
0
votes
0answers
28 views

Batch update/edit Commerce product slugs to match their SKU?

Our client has entered hundreds of products from their catalogue, but their autogenerated slugs are inconsistent with their SKUs. Eg in the screenshot below, the first 3 products have correctly ...
0
votes
0answers
22 views

Setting a variable to a Matrix field with additional parameters

I'm trying to set a variable to a Matrix field and apply additional query parameters like so: {% set monthDates = entry.scanDates.type('dates').date('and', '>= ' ~ currMonthFirst|date('Y-m-d'), '&...
0
votes
0answers
24 views

Rename files uploaded to certain sources in Craft 3

I have an event written for Craft 2 which renames files, which are uploaded to certain sources, to have a 35 character random string, plus its original extension. I am looking to update this for ...
0
votes
0answers
41 views

Hooking Event After Record Save

I have a custom module that is receiving data from an external API. I need to save some of that data into a record and return a success response, so far all is good. Along side this I want to set up ...
0
votes
0answers
53 views

CSS folder with XAMPP and Craft Cms

I am using XAMPP with Craft CMS 3. I am doing the tutorial with craftquest. I have moved the stylesheets folder into my web folder but craft cant seem to find my folder? How do i make craft find the ...
0
votes
0answers
29 views

How to disable “show On Homepage” option from CP

I am created entry. That entry contains title and page content. And the title of the entry show on menu bar of my site. But I want some entry to not show in the menu bar. How can i do this?
0
votes
0answers
21 views

How to access controller method from a plugin script?

I have created a custom TwigParser which needs to execute some controller logic in a similar way to how CraftCMS's {% requirePermissionNode %} Twig parser does. Their implementation accesses the ...
0
votes
0answers
87 views

SCSS is not parsed in CSS using the SCSS plugin

I have a quick question about the SCSS plugin for Craft CMS I have successfully installed and activated it. Dependencies like leafo / scssphp are also installed. In the I have included the files: ...
0
votes
0answers
37 views

Craft CMS: Goes Unresponsive

I have an issue with the Craft3, after a few requests and clicking around the whole site (front-end and CP Admin) seems to hand and lag. Also I get a popup message on Google Chrome mentioning that ...
0
votes
0answers
22 views

Possible to move matrix content from one global set to another

Is it possible within the database to manipulate a couple of keys to move matrix content to another global set without having to re-enter it all in Craft 3? I have the matrix field in both global ...
0
votes
0answers
66 views

Category select field in custom plugin settings not saving

I am trying to show a list of categories on my plugin's settings page so an admin can select multiple categories. I am doing this with a Craft form macro: {{ forms.elementSelectField({ label: '...
0
votes
0answers
95 views

Shopify - Connect existing Element API/Vue JS site to new Shopify store

I have a Craft 3 site, currently running using the Element API and Vue JS as follows: VueJS: Product grid component ... mounted(){ this.getGridProducts() }, data() { return { ...
0
votes
0answers
138 views

Can't save fields

I want to change some fields and when I click 'save' it goes to the list of fields and the changes aren't saved. I can't add fields either. I can add and edit entries for example.
0
votes
0answers
39 views

Install of Craft 3 on Windows server gets 404 error on admin pages

I have tried installing Craft 3 onto a Windows 2016 server a few times and I've gotten the same issue where after an install I am redirected to the Admin page and have a 404 server error. I am using ...
0
votes
0answers
71 views

FeedMe Import Error: Can not create a node when the target node is new record

Trying to do an import using FeedMe. Earlier it was just a few entries are not created, getting the below error in the logs. i decided to start again, delete all entries and re-import, now no entry is ...
0
votes
0answers
76 views

How to save a Neo block content with Super table block content

I'm using Neo blocks as part of an import process and I'm struggling to figure out how to do this via PHP. The following code snippet (a standard approach of setting the field value with an array ...
0
votes
0answers
18 views

Update the element selection in BaseElementSelectInput via Javascript

I am building a javascript helper to assist user to populate some Entry/Category data. For the BaseElementSelectInput widget used in Entry/Category field when editing an entry, is there any way to ...
0
votes
0answers
59 views

Custom field value doesn't get saved

I have the following code: $fieldHandle = 'contentLead'; $entryTitle = $event->element; $entryQuery = \craft\elements\Entry::find(); $entries = $entryQuery->title($entryTitle)->limit(1); ...
0
votes
0answers
42 views

What's the difference between `checkboxGroupField` and `checkboxSelectField` in Craft 3?

Short: What exactly is the checkboxGroupField used for? And why not just using the checkboxSelectField? Long: I am building a library that's gonna be required by a couple of my future Craft plugins ...
0
votes
1answer
74 views

An unknown error has occurred in asset reindex

I am getting the error: An unknown error occurred for each file in a folder when I try Update Asset Indexes. The folder is a local folder that is outside of webroot. The files just contain json data....
0
votes
0answers
15 views

Craft 3 Image doesn't change after save when editing from matrix

when I edit an image in the image matrix block and save the asset, the changes doesn't affect the image thumbnail preview. The thumbnail preview changes only If I save the page. Video of the issue. ...
0
votes
0answers
41 views

Image Transforms: getUrl('handle') not displaying - Craft 3

This displays the image in my asset volume perfectly: <div class="row hp-brew-item" style="background-image:url({{ entry.drinkImage.one().getUrl() }});"> When trying to apply the image ...
0
votes
0answers
27 views

Craft 3 Session Ended modal popping up on local machine

Using MAMP Pro 5.1 Apache, self-signed SSL cert PHP 7.2.8 module mode OPcache enabcled Extensions: Xdebug, Imagick/ImageMagick Craft 3.1.22 Basically I'm having the same problem as tons of other ...
0
votes
0answers
20 views

Access all entries when selecting an entry on multisite setup

I have a Craft 3 multi site setup. For example: - Site A - Site B - Site C Only Site B has a blog (channel). So the channel 'Blog' is disabled for Site A and site C. Now, I want to link to a specific ...
0
votes
0answers
31 views

How can I overwrite the search page within a plugin?

My first day with Craft. I want to create a plugin that will provide a Product Query (collection, Craft Commerce) based on some 3rd party search (like Algolia). How can I overwrite the route search?...
0
votes
0answers
16 views

How can I remove /index from my homepage of Craft CMS?

How can I remove /index from my homepage of Craft CMS? https://pritirathod.com/index
0
votes
0answers
53 views

Get transformed asset URL in controller of module, while using Eager Loading

I created a module, in my controller I want to return the entries with the assets in JSON format. Here is my code. File: In service class, I am getting the data. public function getData($...
0
votes
0answers
24 views

Print to Console Inside Event

I created a CUSTOM PLUGIN and I have the following code: Event::on(FOO::class, FOO::EVENT_NAMED_BAR, function(Event $e) { $message = "Hello world"; // craft::error( $message ); // ...
0
votes
0answers
247 views

Craft update terminated with error and command line update says I'm up-to-date

I'm pretty stuck trying to update Craft (from 3.1.10 to 3.1.24). It used to work previously, but this time I tried a few times using the updator in CP, it always stops at this point: Status: Internal ...
0
votes
0answers
64 views

Freeform Plugin: Form not redirecting to Success Page with Ajax

I have defined {{ siteUrl }}contact/success as my Return URL Ajax is turned on. I have uncommented the following in ajaxify.html if (response.returnUrl) { window.location.href = response....
0
votes
0answers
59 views

Craft 3 cannot upload file to entry in Control Panel

Cannot upload file to entry in CP from a form in the frontend of the site. The flash message in the CP is: Entry could not be saved. {% set section = craft.sections.getSectionByHandle('areaprivada') ...
0
votes
0answers
46 views

Live preview breaks if adding trailing slash to htaccess

I noticed after one of the latest updates that live preview is no longer working, I seem to have narrowed it down to htaccess file which we have modified to add a trailing slash to all urls. e.g. # ...
0
votes
0answers
59 views

Emojis on Craft 3 front office

I'm making a blog. I have a wheelform comments input type that needs to be stored as utf8mb4 in the local database. My MySQL database version 5.6 is configured to utf8mb4 in the database, tables, ...
0
votes
1answer
149 views

Ajax Contact Form not sending with Error 400

Hi I have I'm using Craft CMS 3.1.21.1 with the Contact Form plugin version (2.2.4) and Contact Form Honeypot plugin (1.0.2) along with jquery 3.2.1 on the site. Whenever the form is filled out and I ...
0
votes
0answers
103 views

Assets uploaded image quality is terrible

When I upload a JPG image through Assets, the image quality is terrible. I dont mean a slight difference for web optimisation, but I mean REALLY bad! See screenshot. Can't find any helpful about ...
0
votes
0answers
19 views

How could a non-translateable field be translated for just one page?

We will have many language sites for our client, most of them will be in English, and so do not need to be translated. Then a few will be (German, French, Spanish). The English sites can be the same ...
0
votes
0answers
261 views

Auto trigger craft project-config/sync on deployment

So I have the following in my Composer file: "scripts": { "post-root-package-install": [ "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" ], "post-create-project-...
0
votes
0answers
25 views

Editing Images in Craft Cause Server to Hang

In the assets area when wanting to edit an image (focus point etc), the server hangs after double clicking an asset. If you checkmark an asset and then select Edit Image, set the focal point and ...
0
votes
0answers
18 views

Videoembedder (plugin) 403 & 404 errors

Im using the plugin: https://github.com/mikestecker/craft-videoembedder and has a similar issue as this guy: https://github.com/mikestecker/craft-videoembedder/issues/7 An invalid video url has ...
0
votes
0answers
154 views

Every time I perform updates on Craft 3, I get errors

What is going on in Craft 3, seems like Composer has caused more problems than good. Every time I have had to update a dev/staging environment I run into issues and have to go and manually update the ...