All Questions
1,363
questions with no upvoted or accepted answers
9
votes
0
answers
970
views
How do I upload images programmatically?
I'm working on a plugin that creates auto crops of a selected image, but I am unsure of the proper steps to create and upload an image programatically. I am hoping that Local asset sources and Remote ...
7
votes
0
answers
320
views
Solspace Freeform Upload file dynamic location and duplicate file avoidance
Using Freeform for forms which have multiple file upload fields.
Is it possible to have a unique asset directory for each submission? For example: uploads/maindirectory/submission.id/ I'm trying to ...
5
votes
0
answers
273
views
How does "Use this field's values as search keywords" work with a Matrix field?
I'm fine-tuning a search results page and have noticed that "Use this field's values as search keywords" is included both on the matrix field itself, and within each block type / sub-field. I ...
5
votes
0
answers
200
views
Eagerloading Matrix fields resulting in empty array
I'm trying to eager-load a Matrix field with it's blocktype and related field types. For some reason the _eagerLoadedBlockTypeElements are empty arrays.
If I get rid of the with clause on ...
5
votes
0
answers
428
views
How to load components into Craft 3 plugin?
what is the correct way to load third-party components into Craft 3 plugin I'm developing?
I tried adding
$this->setComponents([
'authClientCollection' => [
'class' => '\yii\...
4
votes
0
answers
552
views
Commerce 3 products with dynamic options
I am well-versed in CraftCMS and am finally able to use Craft Commerce 3 for the first time on a project (first time for any version of Commerce, actually) and it's to build a platform for a butcher ...
4
votes
0
answers
697
views
How to Upload Multiple Assets Using Frontend Form
I'm trying to create a more interactive experience to upload moultiple images on a frontend entry form.
Things I have done:
I have implemented the code here: https://docs.craftcms.com/v3/dev/...
4
votes
0
answers
178
views
Testing / Fixtures: setup Entries in Structure
Background: I have experience with vanilla PHPUnit testing of projects, but this the first attempt at both testing a Craft project and using Codeception for testing.
Case: I have a section of type ...
4
votes
0
answers
231
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 ...
4
votes
0
answers
422
views
User Event before Login - check if user has password and logged in before
Is there a User Event before the authentication is fired?
I want to show a message if the user doesn't have a password yet and if it's his first login / check if he never logged in before - All in ...
4
votes
0
answers
146
views
Does Freeform Pro save partially completed entries or "drafts"?
I'm building an 8-page registration form or application and was hoping to use Solspace's Freeform Pro. I have some experience with it, but not in all of the capacities I'm hoping to use it for on this ...
4
votes
0
answers
867
views
How to handle Craft 3 events in a plugin? Element API is returning null data
The below refers to Craft 3 and the Element API plugin for Craft 3.
I would like to do something when the Element API plugin fires its onBeforeSendData event, I can see in the controller for element ...
4
votes
0
answers
3k
views
runtime isn't writable by PHP. Please fix that
I keep getting the error:
mydomain.com/craft/storage/runtime isn't writable by PHP. Please fix that.
I am running Redhat, and have set the folder permissions to 777, any ideas?
Thanks in advance.
3
votes
0
answers
624
views
Craft in Docker throws '/app/web/cpresources doesn’t exist or isn’t writable by PHP'
I'm trying to deploy a Dockerized Craft CMS website. The basic setup is as follows:
craft running in Docker
nginx running on the server, using proxy_pass to point to docker container
The setup ...
3
votes
0
answers
155
views
Add billing address to user on registration
I am working on a craftcms + commerce project and I need to add a billing address to new user during its registration process. The idea is to have a billing address added to any newly registered user ...
3
votes
0
answers
990
views
Multiple Entry Types on GraphQL Fragment
So I am building out a Gatsby Site, which is using Craft in Headless mode as it's content source.
In one Section, I have three entry types. Currently they have identical fields, but may diverge in the ...
3
votes
0
answers
92
views
Freeform: Change field conditions between multi-page forms
I'm trying to only show some fields on Page 2, if a condition from a <select> box is met on Page 1. However, when I add Field Rules, I only have access to fields from the same page of the form.
...
3
votes
1
answer
982
views
Request must accept JSON in response
I am getting error message while loading entries from dashboard. Please see attached screenshot -
While looking into browser console, I found the error message Request must accept JSON in response (...
3
votes
0
answers
122
views
Craft Commerce: Create new shipping zone by excluding other zones
I need to create 3 shipping zones in Craft Commerce 2 (currently on v2.1.7):
UK
Europe
Rest Of The World
Having to manually add the countries to the UK and Europe zones isn't too much of an issue, ...
3
votes
0
answers
306
views
Copy Content from original site to new site (multi-site)
I have an English site with content, but now I need to create another site in French. So I'm setting up a multisite for my Craft install. I want to copy over all my English content over to my new site ...
3
votes
0
answers
34
views
What are the replacements for the order events onBeforeAddToCart and onBeforeGatewayRequestSend in Commerce 2
I'm looking for replacements for the events onBeforeAddToCart and onBeforeGatewayRequestSend.
I used onBeforeAddToCart to prevent the user from adding an article from different article groups to the ...
3
votes
0
answers
649
views
Searching for Multiple Categories and Tags
I've been pulling my head for the past day on how to filter products with multiple categories.
After a long search, I found and implemented on my project, Advanced Search with tags and categories
It ...
3
votes
0
answers
140
views
Recommendations on integrating Craft 3 and FormAssembly
I was wondering if anyone could give me some advice.
We have a client that we are in the process of moving away from a Drupal build to a new Craft build, however, they have a large number of forms ...
3
votes
0
answers
490
views
JsonLD & Schema
What is the best way to use Json-LD schema in the templates for Craft 3? I would like to dynamically load parts of the info. I know about the SEOmatic plugin but looking for a way to do it on my own.
3
votes
1
answer
464
views
Displaying errors on frontend user forms
I'm trying to get some feedback for the user on registration when the username already exists but I don't know in which object the errors are.
I use the form they provide in the docs:
https://docs....
3
votes
0
answers
113
views
Can you make Craft 2 Stateless?
So we are moving to Google App Engine Flexible which means we cannot store sessions on files. So I wanted to know if anyone has been able to make Craft 2 Stateless and how was it accomplished?
Thanks....
3
votes
1
answer
169
views
Craft Commerce - Different confirmation email address for different product types or category
On a website I will be setting up there will be different ranges/types of products.
Basically purchased from different departments within the organisation.
I can filter the products in different ways ...
3
votes
0
answers
116
views
Dukt Social Plugin Not Creating User
I'm currently Authenticating users via OAuth and Social Login by Dukt. I have Facebook app all set up and running as well as Twitter. The user gets redirected, asked to Authorise but when it returns ...
3
votes
0
answers
205
views
How to import LinkIt (custom) fieldtype with Feed Me into Super Table
I'm trying to import a LinkIt fieldtype into a Super Table with the Feed Me plugin. I've tried several ways but doesn't seem to be working. The part in my json which gets mapped to the Super Table ...
3
votes
0
answers
106
views
Algolia indexing disabled items in Craft
We have Algolia search running on our Craft install through the Search Plus plunin. When I disable an entry I'm finding that it is still searchable through Algolia, which then results in a broken link....
3
votes
0
answers
317
views
Is there any way to include Solspace Calendar events in a global site search?
I have a client that wants their Solspace Calendar Events to show up in the global site search results (along with entries from other sections)
My first thought was to query the entries and calendar ...
3
votes
0
answers
381
views
Select Freeform email recipients from dropdown (not dynamic recipients field)
I have a Freeform form where the user selects their area of interest from a dropdown. I need the email to be sent to different email addresses, based on the area of interest (some will have multiple ...
3
votes
0
answers
464
views
Restrict each user to a single Assets folder
I need every control panel user to have a single assets folder that is private to them. Is there any way of achieving this in Craft?
I've tried using the "Restrict uploads to a single folder?" option ...
3
votes
0
answers
603
views
Currency switcher
Folks:
I'm setting up a multi-currency site (CAD, USD, EUR). I'd like the user to be able to select their currency before they actually put anything in the cart. And once selected, prices throughout ...
3
votes
0
answers
135
views
Assigning category permissions to users
Is there a way to assign category permissions to users so that they can only view/edit those categories?
I am currently looking at the following getEditableSections(), however, it's displaying all ...
3
votes
0
answers
216
views
Neo performance (large page)
I'm using Matrix and Neo to build out quite large, complex entries.
On larger pages (70+ blocks each with one-multiple sub-blocks) the performance is taking a bit of a hit taking upwards of 40 seconds ...
3
votes
0
answers
413
views
How can I create a dropdown field programmatically with a plugin?
I'm trying to create a Dropdown field and add it to the User field layout. I've successfully created an empty dropdown field (no options) and added it to the User field layout.
Here is my current ...
3
votes
0
answers
168
views
Image transforms directory not being created
I've upgraded to El Capitan from Yosemite, created several Image Transforms in the CP (see pic) but they don't seem to be creating the folders in the uploads dir. I've checked folder permissions for ...
3
votes
0
answers
90
views
Set default order of Custom Fields inside Layout Tab
I'm writing a custom plugin, and I want to specify a custom order of the Fields in a tab. My plugin installs several fields, and I want the user to be able to simply add the tab that contains my ...
3
votes
0
answers
102
views
Responsive control panel styles
I have a plugin that extends various Craft templates and styles, however, in one area it requires some custom Control Panel styles that Craft has not already created. As the Craft Control Panel is ...
3
votes
0
answers
140
views
How can my plugin use Craft's native dragdrop support
I am using a generic Garnish modal from Craft like so:
$container = $('.upload-modal');
$modal = new Garnish.Modal($container, {
autoShow: false
});
I would like to have craft's native drag&...
3
votes
0
answers
639
views
Craft Commerce Product Reveiws
For those who have implemented Craft Commerce and needed product reviews, what has been a good solution for you?
3
votes
0
answers
294
views
Getting related entries along with entry using the Element API plugin
I want to list all the related entries to the entry I am displaying using the Element API plugin.
I have a channel called series and another called episodes, the episodes have a relationship with 1 ...
3
votes
0
answers
510
views
How can I use the ElementAPI to get related entries based on two parameters?
I can successfully get entries related the "normal" way, but my list of possible results are getting quite large. Currently I am returning html mixed in with the data. It's obvious I need to get just ...
3
votes
0
answers
696
views
What's the easiest way to update an entry from the front end as a guest user and only post the data that needs to be updated?
I'm creating a multi-page form on the front end of a site where different data is added to the entry depending on the page they are on. Originally I was going to create the entries using P&T's ...
3
votes
0
answers
206
views
How do I traverse relationships when populating models from queries?
I have three models / records - Journals, Issues, and Articles. Articles each BELONG_TO an Issue. Issues each BELONG_TO a journal. Issues have a date on which they've been published, and I am trying ...
3
votes
0
answers
254
views
Dukt Video plugin oAuth issue with development environment
I'm wondering if anyone has come across this issue I have with the Dukt Video plugin and oAuth using it in a development environment using craft.dev?
Google oAuth only excepts top level domains for ...
3
votes
0
answers
313
views
Trouble saving custom fields onto custom element type
Im working on a plugin with a custom element type and i have most things working but i haven't been able to get custom fields to save with my elements using setContentFromPost.
I have the record and ...
3
votes
1
answer
225
views
Using setTemplateMode on the frontend
I'm trying to access a CP template from the frontend, and i'm doing something like this in my plugin:
<?php
...
$oldMode = craft()->templates->getTemplateMode();
craft()->templates->...
2
votes
0
answers
27
views
Allow filtering elements by fields on related elements in element indexes
I'm trying to show some additional columns in the entry index, and allow editors to filter and sort by them. The problem is that the fields that need to be used for sorting are set on related entries, ...