Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
1 answer
36 views

How to make checkboxSelectField sortable?

i am trying to make checkboxSelectField sortable so far i have only managed with inclusion of third party scripts (sortable in jquery.ui). The code looks like this: Twig: {% import "_includes/...
23 votes
1 answer
2k views

How can my plugin generate a generic modal window in the Control Panel?

I'm working on a plugin, and it requires a modal to be displayed when the user interacts with a field of my Field Type. When the user finishes interacting with the modal, they would click "Done". ...
1 vote
1 answer
205 views

How can I use asset select modal in utility?

I created a custom utility template. Inside the template, I would like to use the built-in asset select modal for the "Add image" button. Any way to do this please?
1 vote
1 answer
232 views

Plugin field-type not getting javascript variable?

Updating a plugin from Craft 2 to Craft 3, so this logic used to work. The plugin has a field-type which is a button. When clicked, the button does stuff depending upon another field. That handle(ID) ...
1 vote
1 answer
506 views

Craft 3 - custom callback after Garnish onDragStop

I would like to trigger a custom javascript function after an element in a matrix block was moved in the matrix but I'm not sure how to attach the event without changing the MatrixInput.js. So far I'...
2 votes
1 answer
178 views

How to access Craft.EditableTable instance in CraftCM

I am developing a custom plugin that has a variable setting that can take multiple options. I've decided to use forms.editableTable from Craft's _includes/forms. It does the job great, saving and ...
5 votes
1 answer
220 views

How can I submit a form from a Garnish HUD footer?

I'm working on a Dashboard widget from which users can submit entries for review from a Garnish HUD, like so... I've started by placing a hidden form next to each little Submit button... <form ...
4 votes
1 answer
426 views

How do I show a Garnish hud in the CP

I've written a custom plugin and added a custom button to the right panel of an entry page Now I'm trying to show a Garnish Hud if I click the red button (like the one when you re-index assets) The ...
3 votes
0 answers
141 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&...
1 vote
1 answer
257 views

When using "createElementSelectorModal()" how do you respect selected locale?

When using createElementSelectorModal() in a plugin, how do you make your source list show items from the current locale selected in the CP? It only seems to show the items from default locale no ...
2 votes
1 answer
349 views

Setting selected elements in a BaseElementSelectorModal (or BaseElementIndex)

I'm writing a Javascript based plugin which creates an instance of Craft.BaseElementSelectorModal. When the modal is created, I'd like to have some of the entries in the modal's element index auto-...
3 votes
2 answers
748 views

Access add and remove events with the Craft Element Selector?

Is there any way to access an event, and trigger some function, when an element is added / removed with the Craft Element Selector logic available in Garnish? I am working on a custom field type and ...
4 votes
3 answers
2k views

JS templating in Craft CP

I'm writing a plugin where I need to render some semi-complex HTML clientside at runtime (all inside the CP). Does Garnish (or any other library/framework/JS-thingamabob shipped with Craft) offer any ...
7 votes
1 answer
557 views

Filtering and sorting lists in a plugin

Whats the recommended way to have javascript based filtering and sort table views in a plugin tab? Is is possible to use garnish to do that or should we be looking at external libraries like: http:...
2 votes
1 answer
584 views

Possible to override Garnish.Modal? [Plugin]

Is there a way to override Garnish.Modal? For example, I have a custom modal which uses a custom form but I want to be able to use the built in forms.elementSelect to select from a user list. When I ...
4 votes
1 answer
542 views

Can Garnish be extended to allow plugins to use custom keyboard shortcuts?

For example, when editing an entry cmd + s saves the entry. Is there an easy way to extend Garnish to allow for my plugin to listen for custom keyboard shortcuts?
2 votes
1 answer
114 views

Is this Garnish message bad? "Element was added to more than one selector"

My plugin has a field type. When I'm editing an entry which uses that field type, this message gets logged to the console: Element was added to more than one selector I can tell that it's Garnish ...