Questions tagged [plugin-development]

Questions having to do with constructing plugins.

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

What's the recommended approach for applying effects on images and saving them in the respective volumes?

I'm creating a plugin in Craft CMS and it has a feature where you can apply certain image effects and after you are done, you can save it in the configured Asset volume. I know that ImagerX also does ...
1
vote
1answer
29 views

Event triggered when Craft sends email

Is there an event that would be triggered every time email is being sent by Craft? So email message can be intercepted.
-1
votes
1answer
66 views

how to create a custom plugin if the user enables plugin settings then it will replace the website home page to my custom design? [duplicate]

I am trying to create a plugin if the user enables plugin settings then it will replace the homepage of the website with my custom designed template
0
votes
1answer
59 views

How to override homepage content through plugin?

Want to override index.twig content through a custom plugin. I want to create a plugin that appends some content on website homepage. How to Achieve this any reference will be helpful
1
vote
1answer
13 views

Make plugin permission appear on permission list, without defining control panel section

How can i make plugin permission appear on permissions list, without setting public $hasCpSection = true; in main plugin class? For now i set this variable to true and then removed section link like ...
0
votes
1answer
42 views

Want to use assets field my template settings in custom plugin craftcms

I am creating a plugin that is based on images the admin will upload some sort of images in plugin settings not sure how to creat image field setting in plugin
1
vote
1answer
16 views

Plugin logging not appearing

I am trying to log sone info on my plugins service work like below: Craft::info( Craft::t('mapitapi', 'Sleeping for 1 secs ..saved funding entry: ' . $element->id . ':' . $element->...
1
vote
1answer
24 views

How to batch a large queue job?

I am trying to batch a large queue job in my custom plugin. Here is my service that starts the queue. public function doBackGroundJob() { $query = Entry::find(); if (!empty($...
0
votes
0answers
20 views

Why is my queue in custom plugin failing on VPS but not locally?

I am working on a background job in a custom plugin. On my local Laravel Valet setup it runs fine until it runs out of time. On my VPS which has same php version and memory settings (and mysql db) the ...
1
vote
1answer
27 views

Index table not displayed on new element type

I am writing a data tables plugin and am currently working on the index page in the CP. I've followed the instructions here: index.twig {% extends '_layouts/elementindex' %} {% set title = "...
1
vote
1answer
28 views

Save metadata on entry without creating a corresponding field

I am trying to add a seeded:true flag to dummy entries seeded during development, so I can automatically weed (delete) them later when I'm ready to save the actual live content. I know I can create a ...
1
vote
1answer
21 views

How can I see what fields changed on EVENT_BOEFORE_SAVE and or EVENT_AFTER_SAVE

I want to see what data is changing whenever someone is updating an element to act on the difference between the states. In this particular case a User, but more abstractly speaking, an element. In ...
1
vote
1answer
83 views

upload base64 image -> save in assets -> custom plugin

I started coding a custom plugin, it takes a video file from the asset and showing the file in a video-player (CP). The user is now able to take screenshots of the video (using JS) by clicking a ...
1
vote
1answer
42 views

Upload asset via API - Asset saved under root folder

I am trying to seed some images to an existing volume programmatically. The code I'm using is taken (almost) verbatim from Craft's AssetsController@actionUpload: $filename = Assets::...
1
vote
1answer
26 views

Check for existing jobs in queue

Is it possible in code to search for a job/list out all jobs? I have built a plugin that scans an external API and I want to scan on an interval as well as allow the user to fire off a manual scan. I ...
1
vote
1answer
38 views

Install plugin from another plugin

I'm trying to use Redactor as a dependency for a plugin I'm writing. I need it to be installed before I run my Install.php migration, because in the migration I'm creating a Redactor field. Following ...
0
votes
0answers
25 views

getDirtyFields returning more results than expected

I have a module that sends an email whenever a specific entry field is updated. Everything is working fine except that the field is being passed to the dirtyFields array even if it has not been ...
0
votes
0answers
21 views

Send email from two different addresses using SMTP

I have a configured and fully working Craft 2 website that sends emails using the SMTP settings I have set in the admin panel. I am in need to send a specific email in a certain situation from a ...
1
vote
1answer
14 views

Composer Unexpected end of file on new plugin

I'm making a new Plugin for CraftCMS, it works fine locally but when I call the services class on our staging server it throws a Syntax Error, Unexpected end of file. I've installed them both through ...
1
vote
1answer
44 views

Manipulating search event

Looking at a means to perform subqueries against certain searches in the back-end of the Craft CMS eg for searches against particular sections within Admin > Entries. Looking into this it seems ...
1
vote
1answer
17 views

Limit elementSelectField to specific sections

How do I limit this elementSelectField to only allow entries within a certain section? {{ forms.elementSelectField({ label: 'Blog post', name: 'blogpost', elementType: 'craft\\elements\\Entry', ...
1
vote
1answer
29 views

How do I renew Craft CMS license?

When I go to Updates in my home Dashboard, I see there are "5 updates available!" I click "Go to Updates" and a big orange ribbon pops up that reads: Your license has expired! ...
0
votes
1answer
27 views

All Plugins Showing "Not Installed" After Promoting Changes From Dev to Stage Environments

We are using the custom exec widget to move the codebase, backend fields, section creations, and images from one environment to another. We have Dev, Stage, and Production environments. After ...
0
votes
0answers
32 views

How can we create the Martix type field?

In Plugin development, I have created a field, Is it possible to create a field as a matrix field or I will have to create custom add more functionality?
0
votes
1answer
86 views

Posting data from CP to Plugin controller results in server error 500

I am currently trying to write my 1st Craft plugin. The goal (simplified): Backend users select a bunch of pages in the CP, and create a PDF. The result is an annual report that's optimized for print (...
1
vote
1answer
29 views

How to display controller response on twig template?

In the plugin, I created a form and after the process, return the below response from the controller and redirect to the template. I am trying to print the response to the template but it's not ...
1
vote
1answer
33 views

Create a channel programmatically

I am diving into Craft plugin development and there is one thing that I want to achieve, but I didn't find any documentation. I managed to save specific new entries into a channel using saveElement(), ...
0
votes
0answers
66 views

Guzzle fatal error using Craft Guzzle client

Using the code below to get 3rd party API $uri = $baseUri . '/area/' . $areaId . '.geojson?api_key=' . $mapAPIkey; $client = Craft::createGuzzleClient(); $response= $client->request('...
1
vote
2answers
37 views

Running a background job in a controller

I am trying to run a background job in a controller but wondering if its actually possible. I'm not sure about namespacing and could do with some guidance on whether the job should be running in the ...
0
votes
0answers
10 views

Running a a join query in a plugin with a background job API call

I'm working on a plugin and need some steering. I have two sets of entries that are linked by a foreign key value. (They are not related entries but lsoaname value corresponds to a field in 2nd set of ...
1
vote
1answer
29 views

Can some one explain Event rules in plugins

So here is what I see in a controller: $event->rules['cpActionTrigger1'] = 'plugin/default/do-something'; What does the first part 'cpActionTrigger1' refer to and what does the second part refer ...
1
vote
1answer
68 views

Why do i get an Invalid route error in cp when calling plugin action?

I have a plugin that has a menu and in backend which basically has a button that calls the plugins default controller actionXXXX method. The action does some database / api work then is meant to ...
0
votes
0answers
13 views

Include File In Multiple Plug-Ins

In Craft 2, I would like to share the same include file among several different plug-ins. Is this possible, and, if so, where in the directory structure would that include file go? Thanks
0
votes
0answers
15 views

OAuth Client library query

We are looking into extending the venveo/craft-oauthclient plugin to use the TheNetworg/oauth2-azure Provider. However we need to set this up to authenticate via the client_credentials grant type as ...
3
votes
1answer
44 views

How to loop through specific entries in plugin and edit and save

I want to update some custom field values on my Entries with data from a third-party API, via a Plugin or Module. How do I load the relevant Entries, and one-by-one set and save the new data in my ...
1
vote
1answer
19 views

Multiple shipping method for a single order

We have a website with Craft CMS. We sell and export goods to different countries. Our customers can select multiple shipping method. For example if they had 10 different item on cart, they could ...
0
votes
1answer
22 views

How to alter CP entry edit form

On an entry edit form I'd like to alter the options in a multiselect field to be user relative. Is there something like a form_alter hook?
0
votes
1answer
16 views

How can I revert a migrations from the control panel?

Is it possible to revert a migrations from the control panel?
1
vote
1answer
10 views
1
vote
1answer
40 views

Loading JavaScript on Template Load

I'm working on a kiosk-type plugin which will cycle through all news entries, beginning upon template (or page) load. It needs to load a JavaScript ajax script for this on page/template load. Would ...
1
vote
1answer
20 views

I am working on a plugin and I have to use a method of one controller in another controller's method?

As I have a method name statistics() in my defaultController and I have to use the same method in viewController is there any way to do so?
1
vote
1answer
54 views

Can't register custom adjuster with Craft CMS commerce

following https://craftcms.com/docs/commerce/3.x/extend/adjusters.html#writing-an-adjuster I am trying to make a custom adjuster: I placed class myPlugin extends Plugin{ Event::on( ...
0
votes
0answers
108 views

"RuntimeException" Could not scan for classes inside "vendor/google/apiclient/src/Google" which does not appear to be a file nor a folder

I am using the google-client library in my plugin but it is working in my local system, and when I try to live it on plugin store so only main project composer is updated and then giving this error &...
0
votes
0answers
19 views

Testing adding fields to an entry type field layout

I'm writing unit tests for a plugin that reacts to adding fields to field layouts, I'm trying to add fields to a layout programmatically but can't get anywhere, In the example below (method ...
0
votes
0answers
11 views

Query date field, timezone not taken into consideration

I'm trying to query a custom table on a DATETIME field. My timezone is UTC+2 and the dates stored in the database are UTC. shiftEnd in database: note that the shifts ends at 08:35 UTC, in my timezone ...
1
vote
1answer
24 views

Install a plugin in a unit test

I'm writing some unit tests for a plugin I've made using codeception. I need to test the installation of another plugin during a test. Defining the plugin in codeception.yml doesn't work, the plugin ...
2
votes
1answer
53 views

Adding column to CP entries without writing plugin?

Is there a way to add a column to the control panel display of entries? I would strongly prefer to not write a plug-in for this. The contents in the column would be nothing more than a button that ...
1
vote
1answer
40 views

UrlManager::EVENT_REGISTER_CP_URL_RULES event not firing in custom plugin

I'm working on building out a custom plugin for Craft 3 to create a new element type called Events. Following the Craft docs for creating edit pages, I hit the point where I'm trying to register my ...
1
vote
1answer
50 views

How to build a custom fieldtype containing multiple nested groups of text and dropdown pairs?

I'm working on what I thought would be a relatively simple plugin; a custom fieldtype that would have 8 "sub-groups", each of which would consist of a numeric text field and a dropdown field ...
1
vote
1answer
64 views

What is the best way to create a designed Facebook feed on Craft CMS website?

Hi I'm looking for recommendations as to how to create a designed Facebook feed on the home page of a Craft CMS website please? I'm not a big fan of them but the client has requested it and it's a ...

1
2 3 4 5
35