All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
10 views

Asset field in Commerce product variant - how to upload file to folder with product slug

I added asset field to commerce variant field layout. What value do I need to set in field settings "Upload Location" field? I tried to use {slug}, {owner.slug} and {owner.owner.slug}, but I got this ...
1
vote
1answer
11 views

Nesting level too deep - recursive dependency?

I've got a page with a couple of levels of loops. It takes a section of speakers, groups them by state, and then loops through the states, and then loops through speakers in that state. It's not too ...
1
vote
1answer
18 views

CSRF in plugin dashboard widget 400 error

Yes, it's another csrf question, the standard, 400 Error - Bad Request: Unable to verify your data submission. If in config/general.php I set 'enableCsrfProtection' => false, then everything works ...
0
votes
0answers
15 views

Best way to display relevant matrixblock fields when doing a sitewide search?

I'm building a custom search results page which returns not only the entries that contain the search query (searchQuery), but also, the actual text/content in which the search query was found. That ...
1
vote
2answers
29 views

Parse variables into twig email template from custom module

I'm trying to send an email from my module and am trying to pass some vars into my module template that I can render using twig. Please note that this is a module template not a front end template. $...
0
votes
0answers
10 views

404 Error for assets where “Base URL” and “File system path” are different

I am new to Craft 3 and I have seen similar questions asked many but never answered. I want to store my images in a directory that is not public, yet I want them to be served correctly by Craft. The ...
0
votes
0answers
18 views

Deleting primary commerce address throws error

When i try to delete a user address in Craft Commerce, I get an error thrown, saying the address id does not exist. However the address id being passed to the action is output from a loop of the ...
0
votes
0answers
7 views

Redactor, add CSS class to IMG

In Redactor, how can I add a formatting option to Add a CSS class to an image? formattingAdd only works for block elements. So the below does not work. "formattingAdd": { "img75": { ...
1
vote
3answers
17 views

How to create a new Entry model in Craft 3?

I want to create a new entry for a section named 'drinks'(having section id= 6). The namespace of the file having this code is namespace putyourlightson\userguide\controllers;.I copied this code from ...
0
votes
0answers
19 views

Error after Updating Craft

After submitting the last Craft Update over the CP i got the following error: Warning: require(/home/xxx/xxx/xxx/vendor/craftcms/cms/bootstrap/console.php): failed to open stream: No such file or ...
1
vote
1answer
17 views

How can retrieve users custom fields only?

I have created fields for users and also entry type. I want to get only users fields. I have retrieved custom fields but that returns all the fields. $users = \craft\elements\User::find()->id(...
0
votes
0answers
11 views

Cookie policy - customisation with third party cookies

I'd like to add an option to my cookie banner for choosing what type of cookies you want to use. Something like here: (https://hub.docker.com/) So when you click on "Customize" you can choose what ...
1
vote
1answer
28 views

Impossible to access an attribute on a null variable - on the one() method - all() works!

First question - but I think this is a bug (not my fault). I have entries/pages (a structure) - one parent (product overview) with children (products) I have one category group with categories - ...
1
vote
0answers
11 views

Freeform - How to use fieldSearch with table field?

I have a table field with handle "attendee". I would like to search for submissions using data in this field. None of the below works: $result = Submission::find()->fieldSearch(['attendee'=>'...
0
votes
0answers
8 views

Sync existing local images Amazon S3

I installed "Amazon S3" in a website. Is there anyway so that I can sync existing local images to Amazon S3?
0
votes
1answer
15 views

Mass enable entries

I'm trying to set statuses to enabled in mysql. Around 150k entries. The tables are elements and elements_sites. Set status to 1. The query runs OK. In the cp is also everything fine but entries don'...
1
vote
1answer
33 views

Filtering routes

I'm using following code to route urls to specific template '<restaurantSlug:{slug}>-nutrition' => ['template' => '_nutrition/restaurant'], is there a way to limit slug results to ...
0
votes
0answers
24 views

Read File from Main Plugin Page

I'm new to plugin creation for Craft 3 and currently stuck trying to read the contents of a JSON file. I can manage it fine from the Settings page using: protected function settingsHtml(): string ...
2
votes
1answer
21 views

Global Site Variables (Static Page?)

On various Craft sites, I've needed to provide my clients with access to certain variables used across the site. Things like open hours, specific seasonal color palettes, on / off operation toggles. ...
1
vote
1answer
37 views

Additional criteria to filter status of field passed into RelatedTo

I'm trying to save all the images related to an entry in a variable. I need the images that are added through a matrix field in the entry. I'm using the following code, but am then also getting images ...
0
votes
0answers
5 views

Feed-me stops after 5min even i configured it to 30 000 sec

Feed-me stops after 5min even i configured it to 30 000 sec last version of Craft and feed-me
0
votes
0answers
18 views

Craft Commerce 3 Custom Adjuster

I created a new plugin to register an order adjustment to remove tax for Tax Exempt customers, but I'm having troubles getting the adjustment to actually take place. I have a main plugin file as ...
1
vote
1answer
17 views

Campaign UTM Tracking through to form

My client has asked that I track and send campaign information through a contact form. So basically a user might come to the site on this type of URL: domain.com/?utm_source=Facebook&utm_medium=...
1
vote
1answer
18 views

What does {{ hiddenInput('enabled', '1') }} in an entry form do?

What's the purpose of {{ hiddenInput('enabled', '1') }} in an entry form? <form method="post" accept-charset="UTF-8"> {{ csrfInput() }} {{ actionInput('entries/save-entry') }} {{ redirectInput('...
0
votes
0answers
13 views

Craft 3 showing blank screen in devMode on exceptions

There are two things I'm trying to sort out – this is all on a local setup with devMode on: When I do a throw HttpException(...) from one of my module's controller actions, the response is not ...
0
votes
0answers
10 views

Freeform mail recipient via config or env

Freeform allows admins to send a notification when a form is filled in. In the docs, it isn't mentioned if there is any way of using config or env variables in here. Does anyone has experience ...
0
votes
0answers
9 views

Error uploading the file

Error uploading the file: The file system path “/home/ecs/public_html/public/uploads/” set for this source does not exist can anyone help?
0
votes
0answers
12 views

Problems with CRAFT_BASE_PATH

I would like to make a Website for a friend and we are having problems with the CRAFT_BASE_PATH in the index.php We want the folder structure on the server, to looks like this: craftfolder is not ...
0
votes
1answer
17 views

How to save data from a form in Craft? Explain with an example?

where do you handle the POST requests? where do you write the validation rules and flash error messages? where do you write save to db code? (mainly i want to know how do you route a POST request to a ...
0
votes
0answers
13 views

Updated S3 library for Craft CMS 2

I've got a site stuck on an older version of Craft, v2. I'd like to switch to using S3 to store all my assets but I've ran into a problem. I cannot authenticate using the S3 api library, this is one ...
0
votes
0answers
11 views

Can the Freeform Plugin be used with headless mode in Craft?

Anyone know if the Freeform plugin is compatible with Craft's headless state. Or if there are any other form plugins that are?
0
votes
0answers
9 views

Eager Loading in commerce cart

I'm trying to improve the performance of the craft commerce checkout process. I have some image thumbnails in the cart. Since I can't cache the cart I want to use eager loading for improving the db ...
0
votes
0answers
11 views

frontend-editing with redactor?

Has anyone an idea if it is possible to get the frontend editing for redactor text fields working like in their native redactor demos with click-to-edit and air toolbar, for instance https://imperavi....
1
vote
1answer
32 views

How to loop through a table and set variables based on the existence (or not) of data in those tables?

I am using a table field in Craft (price) limited to one row only, used to manage price setting in different currencies on an entry. The three cols each contain number fields with the handles dkk, ...
1
vote
1answer
39 views

Forcing creation of all transformations for all assets

Regarding a similar question I only found the advice to delete a table in the database but because I don't like fiddling with the db very much I like to ask: Are there ways to force craft to generate ...
1
vote
1answer
23 views

Grouping entries by a custom date conditional

I'm looking to group entries based on a condition between two custom date fields and the current date. I'm not even sure this is possible, but this is how it would appear visually: Happening Now ...
0
votes
0answers
20 views

Best way to sync the Live and Dev install/server?

We have a live craft website and are looking into ways to keep a copy of this live site on a subdomain on the same server for development purposes. The ideal way would be to have an identical copy ...
1
vote
2answers
43 views

Routing and Segments

I'm using the following code for now: Route (in the control panel) recipes/{slug} loads _recipes/restaurant In the template to define the restaurant and list its items {% set restaurant = ...
0
votes
0answers
11 views

At what point is siteId set for orders?

I have an adjuster I am trying to get to work, but the order has to come from a specific site in order for the adjuster to be applied. The siteId is 2, but when I try to get the siteId from the Order ...
0
votes
1answer
23 views

Is there a way to ask for an email address before you download a file?

For Wordpress there's a plugin called Email before download (https://wordpress.org/plugins/email-before-download/). I'd like to ask the user's email address before they are able to download a pdf file....
1
vote
0answers
10 views

Import Stripe subscriptions into Commerce 3

Is there a straight-forward way to import Stripe subscriptions into Commerce 3? I had hoped FeedMe or similar would do it, but it seems not: https://github.com/craftcms/feed-me/issues/472 Any help/...
0
votes
0answers
10 views

Ajax loading for filter based on categories in Craft 3

I have a page with blog listed with pagination using craft paginate. {% paginate craft.entries.section(['blog']).orderBy('postDate desc').limit(15) as pageInfo, entryTemplates %} Now I am need of ...
1
vote
1answer
10 views

Search results home page title not showing properly but other pages do?

Usually Google search results shows the <title> value as the title on the results, but with a CraftCMS website it shows the websites name with a colon and removes the last segment? I've checked ...
0
votes
0answers
18 views

Only the Settings page is broken

I downloaded a fresh install of Craft 3.3.20.1 and ran it locally with MAMP. Everything works except that the Settings page gives me the error This page isn’t working \n localhost didn’t send any data....
1
vote
1answer
29 views

What causes an entry's field to be marked as “modified” when the entry is saved?

When an entry is saved, what causes the entry's individual fields to be marked as "modified" in the POST request? I'm trying to troubleshoot an issue where a modified Redactor field that is a child ...
0
votes
0answers
3 views

Upload a database of submissions to FreeForm 3

I have a need to get all of the old submissions in the same database as the current FreeForm 3 install. I know I can export but what about importing?
0
votes
1answer
13 views

Is it possible for an assigned entry (via field type Entries field) to know what it has been assigned to?

I have two entry types 'pipeline' (structure) and 'series' (channel). I know I can add children in a structure, but I want to keep 'pipeline' and 'series' separate to avoid duplication, as a series ...
0
votes
0answers
11 views

How can I change a Commerce tax rate dynamically mid checkout flow?

Many European countries have different tax rates for food and non-food items purchased. For example, Austria charges 10% for food items and 20% for non-food items. Germany, however, has 7% for food ...
0
votes
0answers
26 views

Optimising search query

I was wondering if there is a better way to do a query like this, it takes a long time to execute and I know setting the parent variable is where there's a problem but am not sure of an alternative ...
2
votes
2answers
34 views

Exclude most recent entry type from a loop

Hey everyone I am trying to output entries on the homepage. My goal is that the most recent entry is styled differently. I achieved this by calling the loop too times: {% for entry in craft....

15 30 50 per page
1
2 3 4 5
241