All Questions

0
votes
0answers
6 views

How to read logs?

This might be little vague question, but how do you make logs more readable? Each time Craft runs, tons of log text is generated. Most of it is probably not related to specific problem one is trying ...
0
votes
1answer
5 views

Where should I add the file to write the code for the `afterSend` event for contact form plugin?

I am using the contact form plugin in Craft CMS 3. I want to add the afterSend event. Where should I add the file to write the code for the afterSend event?
0
votes
0answers
6 views

Render Field from FieldHandler in FreeForm Craft CMS

Can we render some particular field from Our FreeForm plugin ? if we can please let me know how we can achieve it.
0
votes
1answer
15 views

Element API — Endpoint has an invalid elementType

I'm trying the Element API for the first time and getting this error message {"error":{"code":404,"message":"Endpoint has an invalid elementType"}} I cannot for the life of me figure out what I'm ...
1
vote
1answer
15 views

Module not loading unless bootstrapped

I'm expanding my Craft website with a small Module, internal to this project. The module currently only defines a new input-field (extending craft\base\Field). I have dumped the autoloader from ...
1
vote
1answer
34 views

Plug-ins for static hosting?

Our local dev environment allows us to run a CMS like Craft but our (government) host is static only. We currently accomplish things with movable type 4, but would like something more modern. MT 7 ...
1
vote
1answer
6 views

How to display Craft Commerce subscription description from a linked entry

I must be missing something obvious here but I don't see any reference to this in the docs. Under Commerce Settings > Subscription plans > You can link a related entry to the Description but it is ...
1
vote
1answer
21 views

Generating a precache manifest for service workers

I'm thinking of using Google's Workbox to pre-cache a bunch of files, and I've been scratching my head as to how to generate unique hashes for files when they change. Something like this: workbox....
0
votes
0answers
8 views

Filter and sort commerce products based on matrix blocks

We have a website that uses Craft CMS v3.1.28 and Commerce v2.1.6.1. The below logic is implemented within a plugin and we're prepared to do custom implementations aka. prepared to go deep! This ...
1
vote
1answer
34 views

How can I query entries based on a Matrix Block Type?

I'm using Element API and trying to create a query that returns a list of entries based on if the entry is using a specific Matrix Block Type. I've tried a few different things including a query that ...
0
votes
2answers
23 views

Craft CMS not working on server

I had my Craft CMS site working on my local hosting. I then moved it over to bluehost VPS. I moved the database and uploaded the files to the server. I've put the database user information in the .env ...
1
vote
1answer
20 views

How to run function after plugin installed?

How can I run a function when my plugin is installed? I tried SafeUp in migrations but it doesn't work.
1
vote
1answer
13 views

Database migrations on environments - in which env do I apply updates to Craft and Plugins?

When developing a Craft 3 site on a multi-environment setup, where would I apply the Craft and Plugin updates? Should I apply them locally and then commit and replace the database in the dev env, or ...
1
vote
1answer
44 views

Is there any plugin for Blog in Craft 3?

I want to create a Blog website in craft cms. I would like to know, is there any plugin for Blog which we can use in Craft similar kind of WordPress?
1
vote
0answers
10 views

How to fire flash messages when using Event::on()?

I'm looking to hook into an Asset::EVENT_BEFORE_HANDLE_FILE event and toss up a JS flash error if it's above a certain file size. However, the registerJs() function never runs and I assume it's ...
0
votes
0answers
20 views

How to restrict uploads to currently edited site

I've tried /{{currentSite.handle}}/ but this uses current site handle, not the site I'm currently editing. Is there a way to dynamically set folder to currently edited site?
1
vote
1answer
32 views

Filter entries with AJAX

How would I sort blog entries displayed using AJAX? What I want to achieve is initially show all posts from a channel (All) but then let my users sort through these posts with a sub navigation using ...
1
vote
1answer
19 views

Commerce 'Edit Order' page taking 10 seconds or more to render

The individual order view in the CP is taking 10 seconds or more to be displayed, how can we avoid/debug this? PS. Can ignore the errors in the log (I think) as they are just mmikkel\cpclearcache\{...
1
vote
1answer
95 views

How to do CSS/JS bundles/minifying in Craft 3

I would like to combine all of my sites JS-files into one bundle - and perhaps also obfuscate it. Same goes for CSS-files. How would I do that in Craft CMS 3?
1
vote
1answer
18 views

Invalid username or password

After installing Craft 3 successfully, I can't access the admin panel while using the correct credentials. I get an "invalid username or password" message.
0
votes
0answers
13 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
20 views

Element API - Get all category group titles without passing in a handle

I want to achieve something like the following: $categoriesData = []; if ($type === "helpIndex") { $index = -1; $catGroups = Category::find()->group()->all(); foreach ($catGroups as ...
1
vote
1answer
24 views

Is it possible to create this type of custom field?

We need a field that holds assigned postal codes. Each Location entry will have this field and I'd like to have the following: Buttons to assign postals by city, state, county (data grabbed from ...
1
vote
2answers
27 views

Issues with Craft Commerce [on hold]

We have a dutch website build with Craft CMS and for the webshop Craft CMS Commerce. This has been done by a design company. We don't receive any orders and I am wondering if the whole process is okay....
0
votes
0answers
8 views

How do we eager load locales with criteria in eager loading?

I can eager load in element-api the site name in the criteria passed, but i cant find a way of getting the language locale id into the criteria. This works return [ 'resourceKey' => '...
1
vote
1answer
33 views

Craft 3 redirect of existing and non-existing URLs

I'm upgrading a relatively large, but low budget, local government website from Craft 2 to Craft 3. The major remaining pain point is a replacement for the Craft 2 Reroute plugin, which is not ...
0
votes
0answers
7 views

Is it possible to set default language or site id globally in element api?

Id like to load up all french content for all endpoints in the api plugin. I can do it per endpoint but can it be done for all endpoints?
1
vote
1answer
27 views

No plugin exists with the handle “contact-form-extensions”

I have installed and used the Contact Form Extensions plugin a few times but this time it's not working. I can see it in the CP but when I click to install it throws the error: Invalid plugin – ...
2
votes
1answer
17 views

How to register a new System Message email

I want to send a welcome email to the user when they sign up (not an activation email). I can see the email and edit its text in the Control Panel, but the email doesn't send when a new user ...
1
vote
1answer
23 views

CRAFT_BASE_PATH problems when installing Craft 3 in subdirectory

My client wants Craft 3 installed in a subdirectory of the main site. So I placed it in http://mainsite.com/subdir. The issue now is that the webroot for the domain is at http://mainsite.com, so my ...
1
vote
0answers
10 views

Locales with independent language and country

How might we use Craft to manage our locales, keeping our language and country logic independent? The desired scenario: No duplicate language entries: Spanish in Spain would be the same as Spanish in ...
1
vote
1answer
24 views

Neater way to merge this conditional entry query?

I know there's a better way to do this - eg by merging in the relatedTo parameter if categorySlug is defined rather than defining 2 different queries, but I can't for the life of me figure it out... ...
1
vote
0answers
28 views

Sorting Entry Query Related By Custom Field

I am currently trying to speed up a website I work on, and would like to implement pagination as an index page is currently loading over 350 entries. Each entry has a relation to another which holds ...
1
vote
1answer
14 views

Internal Server Error - getDateFormatter() on null

When doing a manual update from 2.6.3012 to 2.7.8, I get the following error: Internal Server Error Call to a member function getDateFormatter() on null I get the following error when enabling ...
1
vote
1answer
16 views

Commerce 1: Different default order status based on product types

I want to assign different default order status based on product types. Is this possible? What I need to achieve is to send different email notifications based on product types. Can this be ...
0
votes
0answers
8 views

Commerce 1 Cart Tax Zone

In Commerce 1, is it possible to find which tax zone is being applied to the cart? I couldn't find that in the Order model docs.
0
votes
0answers
13 views

How to setup Bootstrap 4 Carousel with Craft CMS 3?

I'm hoping to get some help or guidance on a issue that I'm having. I am using Bootstrap 4 as my CSS framework and wanted to integrate a working Carousel with my web project. I managed to get the ...
1
vote
0answers
9 views

Allow logged in user to change his own user group using front end form

I'd like to allow a user to change his user group via front end form. I tried passing the groupId as the destination group, but it doesn't seem to work. This is what I was passing: <input type="...
1
vote
2answers
27 views

Turning off a site in multi-site/multi-environment config

Given a multi site setup (domain1.com, domain2.com) that also uses multiple environments (dev, staging, production) - how would one configure one of the sites to be turned off in the production ...
1
vote
1answer
24 views

Get entries based on multiple fields in controller

I am trying to get the entries based on multiple fields. Fields can be of type tags, checkbox, radio box, and number. In my controller currently what I tried is. $extrafilter will be like Array ( ...
0
votes
0answers
17 views

Getting an update error

I tried running ./craft update and got: Warning: require(/Users/xxx/Sites/xxx/vendor/craftcms/cms/bootstrap/console.php): failed to open stream: No such file or directory in /Users/xxx/Sites/xxx/...
1
vote
1answer
14 views

Redactor or another HTML editor that can inherit actual page styles?

is it possible for Redactor or any of the other editors to actually inherit the styles from the (front end) page it is editing? My client has bootstrap columns etc and the pages have some elements ...
1
vote
1answer
12 views

Uploaded Assets always get 600 File Permission and are therefore not displayed (403 Error)

After a fresh manual Craft CMS install everything runs fine, except uploading Assets. Well, the uploading part works fine but uploaded assets always just get file permissions of 600 (adfrw) Group and ...
0
votes
0answers
9 views

Tag list not displaying All Tags

I have this loop, but it's not actually displaying all tags? Is there a reason for this? {% set relatedTags = user.userInterests.all() %} {% if relatedTags|length %} {% for rel in ...
1
vote
1answer
18 views

Show/display entries next/prev except entries with lightswitch field active

I have projects on my portfolio that link to each other. I'm currently using previous and next links. This is what my code looks like {# Set parameters for prev/next elements list #} {% set params = ...
1
vote
1answer
27 views

PHP Fatal error during installation

I am trying to run craft inside a homestead box. The box boots and installs everything correctly, and when I navigate to http://localhost:8000/admin I see the install screen and can click through the ...
0
votes
0answers
16 views

How do you register template paths from a module or plugin when a console controller action is called?

When developing Craft 3 plugins/modules, we usually tie into the View::EVENT_REGISTER_CP_TEMPLATE_ROOTS or View::EVENT_REGISTER_SITE_TEMPLATE_ROOTS RegisterTemplateRootsEvent events to register custom ...
2
votes
2answers
25 views

Stop Redactor automatically creating hyperlinks

Each time I write a link such as www.link.com Redactor automatically turns it into an active hyperlink. Is there a way to turn this function off?
0
votes
0answers
15 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 ...
1
vote
2answers
25 views

CP Asset thumbnails delivered by PHP

When listing entries with lots of assets (and therefore thumbnails), the server slows down significantly. I realized, that the assets all have the path: https://mypage.url/index.php?p=admin/actions/...

15 30 50 per page