All Questions

1
vote
0answers
13 views

Can't set structured entry parentId in BEFORE_SAVE event using field data

I have created an event that is called on beforeSave within my plugin. Code below: Event::on( Entry::class, Entry::EVENT_BEFORE_SAVE, function(ModelEvent $event){ /...
1
vote
1answer
23 views

Commerce 2 Stripe gateway seems to be working correctly, but order remains unpaid

I am using the Stripe gateway plugin for Commerce 2. I have done the following: Entered the stripe API keys correctly. Set the Webhook URL up correctly in Stripe. Correctly disabled CSRF protection ...
1
vote
2answers
42 views

Import database backup when using docker

I am trying to import a database backup into a craft instance running on Docker, but none of the fields or content from the latest backup are importing. Here are the steps I took I used these ...
1
vote
2answers
106 views

Craft 3 Plugin Development: Add CSS and JS File to Frontend Templates

How do I add js and css files to frontend page loads via a plugin? I did reference this issue: Can a plugin add JS or CSS to the control panel? but that is for Craft 2. Reading the docs here: https:/...
1
vote
0answers
25 views

How to add sources for Entries

The documentation indicates it is possible to add sources for entries like this: use craft\base\Element; use craft\elements\Entry; use craft\events\RegisterElementSourcesEvent; use yii\base\Event; ...
1
vote
1answer
23 views

How do I setup the Login Page to work with requireLogin?

I want to create a login page. It would be a Single. The URI is set to login. So how do I name and map the twig file? I tried: creating a login folder under templates. naming the twig file ...
1
vote
1answer
18 views

Transfer licenses into another Craft ID account

I could only transfer licenses that were not yet assigned to any other Craft ID account. But how can I transfer the licenses, which are assigned with my other Craft ID account?
1
vote
1answer
24 views

Can I setup multiple sites under one Craft install?

I have not used Craft much, but can I setup multiple sites under one Craft install? If I can, which version of Craft is needed? Thanks.
1
vote
1answer
20 views

Edit links in footer

I'm new to Craft and need to add a link to the right side of the footer on this site http://britainthinks.com/ Can't see anything in the dashboard that holds the existing content or any obvious ...
1
vote
1answer
33 views

Combine .htaccess. ( http to https AND www to non www AND remove trailing slash ) extending normal craftcms .htaccess

I can't manage to combine all above options. Tested with several options and examples only the most examples focusses only on on problem. The example of .htaccess below is okay but i cannot manage to ...
1
vote
1answer
30 views

Pass Controller Variables into a Model

I am using a Controller to get Variables from a field in my Plugin. How and what would be the best way to pass and use them in other classes or my main plugin file. I thought about using Sessions or ...
0
votes
1answer
38 views

400 error on login

When I try to login to my admin area, I get this error: HTTP 400 - Bad Request - yii/web/BadRequestHttpException Unable to verify your data submission. The login button stays faded out, but it ...
1
vote
2answers
31 views

Update Craft CMS, now I get HTTP ERROR 500

I have a site that's been running Craft 3 and has been running smoothly for several months now. I was going to update a post today, and noticed that there were updates to Craft 3 that needed to ...
1
vote
1answer
23 views

Rendering HTML Heading Elements in Twig

I am rendering some headings using twig and want to know if there is a better and more readable way of doing the following... <{{ block.headingType }} class="measure-wide">{{ block.headingText }...
2
votes
2answers
41 views

Best practice for naming fields shared across entries in CraftCMS

I have a question about best-practice for naming fields; I am creating a craft site for a football club, which include the following: club name (Global) team names player names These are all ...
1
vote
1answer
20 views

Structure listing order & classes based on lightswitch value

I have a structure called "Projects", which I am currently listing on a page. The layout looks like the below - with the every row starting or finishing with a .wide class thumbnail: This is the code ...
1
vote
0answers
20 views

Installing module via composer

I followed this question like: ... "repositories": [{ "type": "vcs", "url": "git@bitbucket.org:jorgeanzola/mymodule.git" } ], ... "require": { "craftcms/cms": "^3.0.0", ... "...
1
vote
2answers
53 views

Action URLs from CP to a Craft 3 plugin controller

I'm working on my first Craft 3 plugin and want to add some buttons to my plugin's control panel section which post form data to a controller. My plugin is called 'myplugin', the controller I wish to ...
2
votes
1answer
47 views

ImageOptomize and SEOmatic - Is Image Variant Required for Social and SEO images?

Do ImageOptomize and SEOmatic work together - or to be more specific do I need an image variant for the social and SEO images defined in SEOmatic? I have been importing content into a News entry. I ...
0
votes
0answers
65 views

Craft CMS 3 admin panel returns 404 with SSL

I'm using MAMP Pro for local development and was gong to set up my site with SSL this time around. I got a self-signed cert for local dev and I can go to my development site over https:// without any ...
1
vote
2answers
36 views

Accessing Multiple Databases in Craft

Is there a way to access another database outside of the one Craft uses for its content? I need to able to access data fields from an external source for a project I'm working on.
1
vote
2answers
31 views

How can I set an entires status via ajax from a front-end form?

I am trying to set an entires status to disabled from a front-end form. Here is the click event listener I am using: $(document).on('click', '.delete', function (event) { let $this = $(event....
1
vote
1answer
13 views

Error running any Composer command

I am working on a project with multiple developers and another member of the team is getting on with a Plugin to assist with some CraftCommerce integrations. As it's not a publicly available plugin, ...
1
vote
1answer
17 views

Do ImageOptimize Volume Variant Transforms replace Craft's default Asset Transforms?

Do the ImageOptimize variants that are set on volumes replace the default image transforms that can be set within Craft asset settings? I just want to check as the plugin documentation isn't really ...
1
vote
1answer
23 views

Can I use Craft to Manage Site Access?

User Access Question... Can I use Craft to create users that can only use the site? These users would only be viewers of the content. They would NOT have access to Craft or any of its features. ...
1
vote
1answer
17 views

Access Default User Photo

I'm calling user photo's from my template, but it error's out when trying to obviously call a user photo which is empty. What I'm trying to achieve is if there is no user photo, use the default ...
1
vote
1answer
45 views

Multi-Language Site but the Date should be always in English

with {{ block.timeLimit|date('M d Y H:i')}} i can get the real Date & Time in always the real Language from the Site. If the Page is German output is Dez, in English output is Dec. How can i set ...
1
vote
0answers
16 views

Hide or obfuscate Digital Product file path?

What's the best way to hide the URL from the user/browser task bar? The only way I can get the link to work for a customer is to select the "Assets have public URL", which I really would prefer not to....
2
votes
1answer
22 views

Use an entry field's value in body class

I have created a plain text field that is assigned to a section and is available in the tabs for entries in that section. I want to use this field's value to modify the CSS on my template. My _entry....
1
vote
1answer
22 views

shell script question on homestead

I added a nginx config rewrite rule to remove static asset numbers from file names. It works great on the server config file. # enable static file caching location ~* (.+)\.(?:\d+)\.(js|css|...
1
vote
1answer
16 views

Saving a “craft-linkfield” field via an entry form

I'm editing an entry via an entry form as documented here: https://docs.craftcms.com/v3/dev/examples/entry-form.html How would I be able to save a link field that's using https://github.com/sebastian-...
1
vote
1answer
27 views

Updating User Photo from Front-End

I have this form, there's no errors getting thrown and the User photo field is not updating via this form. <form method="post" accept-charset="UTF-8" enctype="multipart/form-data"> ...
1
vote
0answers
23 views

Escaping rich text fields to json but keep html markup

I am trying to create an export from an old Craft2 site over to a new Craft3 site. The structure and fields are all different, so I figured the easiest way was to create a json file from my entries ...
2
votes
0answers
22 views

How can I get tasks to complete when not logged in to the CP

I've noticed that tasks only run when logged into the admin panel, is there anyway to avoid this? For some context: I have jobs scheduled on a cron to run every 30 minutes, when I log in it seems ...
1
vote
3answers
45 views

Delete Entry from Front End

I have this form <form method="post" enctype="multipart/form-data"> {{ csrfInput() }} <input type="hidden" name="action" value="entries/save-entry"> <input ...
1
vote
1answer
55 views

proc_open() has been disabled for security reasons

I'm trying to update Craft, but I'm getting an error while updating stating it's not possible to make a database backup. I've therefore gone for the suggestion to revert back instead of pushing on. ...
1
vote
1answer
31 views

How to store custom data into a user

I need some direction in how to store (complex) data into users (best practice) I'm working on a project for a fitness app. I created a structure with 2 levels for workouts where level 1 entries are ...
1
vote
1answer
25 views

craft-imageoptimize plugin cropping position

I am using imageoptimize plugin to crop images, but I am unable to find cropping position setup in a template. {% set optimzedImages = craft.imageOptimize.createOptimizedImages( entry....
1
vote
1answer
18 views

Relation fallback if no category has been selected

I have a filter with a few different parameters that get pulled in and I was wondering if there was a relatedTo wildcard that I could use. Here's the relevant code: {% set function = craft.app....
1
vote
1answer
25 views

How to copy Matrix from one entry to another in Craft 3

I've got $entryA with a Matrix field. I want to programatically create a new $entryB and copy the Matrix field from $entryA to $entryB. How do I go about this?
1
vote
2answers
41 views

Does Craft have an equivalent of EE's Custom Fields loop for front-end entry forms?

We're in the process of scoping out an online assessment form to be build in Craft CMS. We need to give the client the ability to add, edit and remove questions (custom fields) and would ideally like ...
2
votes
1answer
19 views

I want to know if I can interface Craft address details into DPD shipping site

New to this and just looking at a few solutions for a small start-up. Would I be able to take address details directly from Craft and interface directly to preferred carrier which is DPD here in UK? ...
1
vote
0answers
17 views

Updating Field from plugin

So i'm trying to update a checkbox field using a custom plugin i built. I have three tiers on my site, tier one that you only get access to certain items, tier two you get access to tier one and other ...
1
vote
1answer
25 views

Displaying gallery when viewing category page or entry with related categories - code review

I have a gallery in my site's <footer> with images that are defined in a matrix field on each of my categories. If I'm viewing a category page or an entry with related categories I want to ...
1
vote
1answer
26 views

Craft 3.1 Beta - Email settings and categories not working

I'm getting an "UnexpectedValueException" on the pages /admin/settings/categories/new and /admin/settings/email after updating to the beta.
1
vote
1answer
29 views

modify image contrast

In my experience is the build-in process of image transform not too kind to the image quality, even with the highest quality. In my case the brighter tones in the images are lost which means that ...
1
vote
1answer
38 views

Variable “entrySlug” does not exist Routing

I currently have a routing set up as follows to enable an "Edit" entry page following on from this question but I'm getting the following error message when going to that page. Variable "entrySlug" ...
1
vote
1answer
15 views

Custom plugin log not logging

I'm having this weird issue that both of my custom plugin logs are not working but all other third party ones including craft.log work fine. By 'not working' I mean the log file is generated, but ...
1
vote
1answer
38 views

Add settings to plugins cp section instead of settings page

I've setup a plugin like so http://domain/admin/plugin-handle (cp section) and a settings page here http://domain/admin/settings/plugins/plugin-handle I can edit my plugin settings under the latter ...
1
vote
2answers
43 views

Edit Entry Page

I currently have a freeform which allows logged in users to create an entry from the front end. I'm looking to build an edit page for each of these entry's so the user can come back and edit it if ...

15 30 50 per page