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
1
vote
1answer
10 views

\ns\prefix\Plugin::getInstance() returns null from another plugin in Craft 3

I'm building a plugin that extends the functionality of the Contact Form Tuner plugin and customize the email recipients based on different scenarios. The email addresses need to be managed in the ...
1
vote
0answers
15 views

Prevent Redactor from stripping tags like <span>

Is there any possible way to prevent <span> tags from being stripped from a Redactor field? I've tried all I can using custom Redactor and HTMLPurifier configs to no avail. Basically what I'm ...
1
vote
1answer
27 views

Choose not to save an element on EVENT_BEFORE_SAVE_ELEMENT

I want to do some server side checks to see if the entry should be saved or not. In my plugin I have something like that Event::on( Elements::class, Elements::EVENT_BEFORE_SAVE_ELEMENT, ...
0
votes
0answers
13 views

Craft3 DateTime is updating todays date on element save

I have an issue where my new element is saving with the current date and time. I won't want it to save with any kind of date/timestamp. Does craft just automatically put in the current date and time ...
1
vote
1answer
19 views

Can't import a complete url into an url field with feed-me

Description I have a JSON feed which contains an external URL like "https://example.com" (entries/external_link/url). There is no error in feed-me logs when I run it, all the text data and assets are ...
1
vote
1answer
32 views

Matrix field within a matrix field

I am working on a product page where I want to give the option to the user to select between which sections they want to use eg banner section, description section, video section etc. Now since the ...
1
vote
1answer
24 views

Strange Link Problem

I am creating a blog with an index page that links to individual blog show pages. I'm having a weird issue where when I click on the title on the index page instead of it linking to: ...
0
votes
0answers
23 views

Toggle class on any tag in Redactor

Is it possible to toggle class on ANY tag in Redactor? This is my current code but it also switches tag to <p> (I guess that's default tag if no "tag" argument is set) when class toggles: { ...
1
vote
1answer
14 views

Image thumbnail generation (on S3/Cloudfront integration) returns blank when first generated

For a client site with S3/Cloudfront integration, we are seeing that images will not be able to load for the first time if they have not been generated before. I'm guessing this is because it takes ...
1
vote
1answer
21 views

Cannot go to site URL while logged in without index in URL

For some reason I can no longer go to my default site URL while I am logged in. Going to http://localhost:3001/craft-site/web/ gives me the following message in Chrome: ERR_TOO_MANY_REDIRECTS ...
1
vote
0answers
9 views

Is any way to add translations for Braintree Gateway dropin interface?

The correct way to add translation to an instance of braintree.dropin is to add options.translations array when calling the braintree.dropin.create method, for example: if ($dropinUi.data('locale') =...
2
votes
1answer
55 views

Is it possible to execute ./craft via cron?

I'm trying to execute Craft 3.3.X CLI commands via cron. I can execute ./craft from ssh no problem, but the same type of commands triggered via cron do not execute. These command works via SSH: # cd ...
1
vote
2answers
32 views

HTTP 503 – Service Unavailable error

I've cloned a Craft 3 repo that was created by another developer and I'm trying to get it running on my local server but I get HTTP 503 – Service Unavailable – craft\web\...
1
vote
2answers
37 views

Generating Webp Images - Webp Installed but not Generating Images

I'm struggling to generate webp images on my forge server. Here is my process in Craft 3. ssh in to the server (forge) Install wepb sudo apt-get install webp Check it is installed and getting piacked ...
1
vote
0answers
24 views

Cannot get asset from custom user field, with no-admin account

I would like to get a file of custom user field, which is "asset", and provide a link to the file for the user. However, the asset file cannot be gotten. The length of the asset field is zero. In ...
1
vote
0answers
21 views

Craft Table/Tabular static entry input field

Is there a way to set up a Craft CMS entry field to have a table with predefined rows and columns? I have tried with the native Craft Table field, but it allows users to add rows or edit default ...
0
votes
0answers
27 views

Craft and Algolia

I am trying to implement Algolia into Craft 3 and am having a few headaches. I am using scout to update my indexes which seems to be working as expected and am using the instantsearch.js ...
1
vote
1answer
10 views

GraphQL private schema returning public schema scope

I am setting up GraphQL on my Craft project, v3.3.16.3 I have a public schema exposing a public entry type, and a private schema exposing a private entry type. When I switch between them in the ...
1
vote
2answers
35 views

Is there a way to make conditional input fields in Craft CMS?

I'd like to use conditional fields in my CMS instance. I found an old plugin called Reasons. I'm not sure it's compatible with Craft 3, so I'm looking for a workaround.
0
votes
0answers
21 views

ElementAPI: How to trigger the Custom service php file when a endpoint is loaded

I am Using Craft 3.3.11 version I have a php file in plugin/elementapi/src/services/EapiServices.php and the same file within vendor/craftcms/element-api/src/services/EapiServices.php When ...
1
vote
1answer
21 views

Delete entries from database

I believe I made a mistake by creating about 15,000 entries in a Structure section. It has caused a lot of problems and so I decided to start again with a Channel section instead. I tried deleting the ...
1
vote
0answers
26 views

Craft 3 memcached session storage in load balanced environment

I'm getting the good old session expired popup every minute in the admin panel which is odd given that memcached should be properly configured: php.ini session.auto_start = 0 session.save_handler=...
0
votes
0answers
27 views

How to get previous and next entry using the native GraphQL API?

How do I turn these Craft queries into a GraphQL one? // entry.twig entry.getPrev({ section: "contentHub" }) entry.getNext({ section: "contentHub" }) I want to get the previous and next entry using ...
0
votes
0answers
10 views

Cart total before shipping and tax (but with discounts)?

Wanting to check this out but it appears that there is no property or method to get a total of all lineItems in a cart plus any discounts (so without any tax or shipping (ie. other adjustments)). It ...
1
vote
1answer
32 views

Template not found error when template file does exist

I am getting a Template not found error. Template not found error: case-studies/_category However the template does exist (see screenshot). I have tried clearing the template cache but still the ...
0
votes
0answers
25 views

Set redirect URL according to some conditions

I implemented an API and in one controller I need to open a webview for the user to enter some data from another site and then come back to my site. I am having trouble setting the redirect URL since ...
1
vote
0answers
26 views

Using multiple elementTypes in Element API

I am currently trying to create an autocomplete search with the element-api. I need results from two different elementTypes: Product::class Entry::class How do I get results out of both elementTypes ...
1
vote
1answer
26 views

Craft 3 on new MAMP Pro 5 installation: “iconv(): Unknown error (22)” problem in /vendor/twig/twig/src/Extension/CoreExtension.php

I have been fighting with a Craft 3 upgrade of a Craft 2 site on a local dev environment for a while now, though much of the time the problems turns out to be MAMP Pro 5 and/or FastCGI PHP. I'm not ...
1
vote
1answer
15 views

Verbb Navigation Plugin Assistance needed

Good morning and thank you in advance. I have one Verbb navigation called main. Underneath that, I have three nodes (see image). Under those nodes are regular links. I want my template to pull only ...
0
votes
0answers
17 views

Save and log in a user from event callback

I'm trying to build a plugin wherein after a user is created via the normal means via a front end template, the user is immediately logged in. My module is watching for the after save event on ...
0
votes
0answers
18 views

Craft using over 1000mb of memory: HTML Purifier and Yii db

I've been getting warnings from my host lately that my Craft website is using around 1000mb of memory and they've had to kill processes (my limit is 512mb). I'm curious, is this normal? Seems to be ...
1
vote
1answer
30 views

Fields Missing. Gone from Database as Well as Control Panel

Recently the organization I work for started a podcast and wanted to add a section on the site where people could find some information about the podcast, some links to subscribe, and more details ...
1
vote
1answer
19 views

Replace # with entry.title

Good morning and thank you in advance. How can I replace '#' with the entry.title. I have tried everything and I keep getting hash errors. Current code is this: <h3>{{ wordBoldTitle|replace({'#'...
0
votes
0answers
11 views

Set the redirect url for a request from a plugin

I implemented an API for my Craft 2 site, One of the requests requires me to open a webview where the user can fill in some forms. What happens is that he enters some info from the app that will be ...
1
vote
1answer
18 views

ERROR: relation “info” does not exist

Be warned this is sort of Docker related question too. I try to build local development environment using Docker (nginx 1.16.1 + postgresql 12.1.0). I've came up to a point where I run the setup ...
1
vote
1answer
18 views

Hide navigation from one entry but not others

I am looking to hide the main navigation for entries that have the lightswitch 'showMainNavigation' disabled. The problem I am facing is when I disable for one entry, the navigation is hidden for all ...
1
vote
1answer
61 views

Securing a Generated PDF

I recently purchased the Digital Download plugin for Craft. I'm wanting to secure a PDF download generated by another plugin called Enupal Snapshot. Reviewing the Digital Download documentation I'm ...
1
vote
1answer
13 views

Craft 3 plugin - how to update entry with field of Entries type

Using PHP, I want to update a field of Entries type of an existing entry. Fields of type Text and Number will update with the following code: $entry = Entry::find()->id($entryId)->one(); $...
2
votes
1answer
21 views

Pass params to transform function of Transformer class in split Transformer class

I have transformer like down below in the element API. 'transformer' => 'MyTransformerClassName', Or 'transformer' => new MyTransformerClassName(), I am going to pass a param like $user ...
2
votes
3answers
80 views

Craft CMS/Feed Me slow performance

I am wondering if I have structured my data badly and was hoping someone could advise on an alternative. Essentially I have a structure with two types, a catalogue and the catalogues children. Some ...
2
votes
0answers
42 views

How to wire html template to twig extension? (Mainly `Twig\Error\SyntaxError: Unknown filter Error`)

I am going to use a Twig filter function by using Twig extension in my HTML file. I followed this guide. https://cameronspear.com/craft-cms-twig-filter-extension/ But when I run <p>{{ 123 | ...
1
vote
1answer
29 views

How to build a web page using different sections created in craft

I am a beginner in Craft. I have a Craft website. There is an HTML design with me. From admin, I divided the HTML into sections and created entries based on that. All the coding related to each ...
1
vote
1answer
26 views

Custom Token Authentication with Craft 3 Login Form

I am building token auth system in Craft 3. https://docs.craftcms.com/v3/dev/examples/login-form.html I used this Login Form. Now I am going to create my own token and save it in user profile. First ...
0
votes
0answers
34 views

Control panel - Entry indexes very slow

Craft CMS 3.3.15 PHP 7.1.3 MySQL 5.5.42 I have a structure with 360 entries. Right now in the CP it takes 3.5 - 10 seconds to load the first 50. And another 3.5 - 10 seconds for every additional ...
1
vote
1answer
56 views

How to debug or log some special variables in Craft CMS? (Especially in a controller)

I am going to debug the variables in controller files. But I couldn't figure out how I can debug it and show the values into front-end site or in log files. Do you have any ideas about this? What ...
0
votes
0answers
11 views

Exception Running garbage collection

When I run ./craft gc I get the following error: Running garbage collection ... Exception 'yii\base\InvalidConfigException' with message 'Invalid section ID: 30' The Section ID of 30 that it's ...
1
vote
1answer
18 views

ERROR 1370 (42000) alter routine command denied to user

I am trying to upload my DB using MySQL Workbench but am getting this error: ERROR 1370 (42000) at line 4534: alter routine command denied to user 'detectalocal'@'%' for routine 'detectalocal....
1
vote
0answers
28 views

“Could not find composer.json file” error in CraftCMS 3

I recently updated my CraftCMS 3 with the help of Composer. When I try to install a plugin with the plugin store, I get an error saying that Craft couldn't find my composer.json file. He proposes me ...
0
votes
0answers
12 views

Is it possible to build its own html form template and loop on tabs/fields with form-builder-3 plugin?

Is it possible to build its own html form template and loop on tabs/fields ? Instead of using this : {{ craft.fb.form(form) }} I'd like to add disabled attribute by default on my submit button. And I'...
1
vote
1answer
13 views

Search return wrong result with special character like @#! in Craft 3

I have implemented search in Craft 3, but it returns wrong result when I enter some special characters like @#!. Is there a way to prevent it?