Adding custom action to post list in admin panel
Created 6 years ago by hemanthpyroI have a custom field "live_video"(checkbox) in my post.I want to create an action(similar to delete action) in the post list for this field "live_video" in such a way that when I check the post (one post at a time) and click the "live_video" button(need to show the button only for "video" category) I need to show a "pop up" with a message "Do you really want to make this post live ". When I click the "Yes" button in the pop up ,I need to make the current post (video) "live" and all other post should be normal(at a time only one video can be live),I need to remove video(post) which was "live" before clicking the button.
I need the button in control panel .I didn't get you piterden
You can add some assets to the form and listeners in JS to the input - use the $assets
property to add stuff like this: https://pyrocms.com/documentation/streams-platform/1.3/ui/tables#including-assets
Bootbox is included in the admin theme so you can use that too. Here's an example of how I use the confirm function for it: https://github.com/pyrocms/accelerant-theme/blob/1.0/resources/js/theme/confirm.js
Using Bootbox works .Thanks 😊
Is there any option to show this button only for a particular "category" in the post list in control panel?
If you are displaying this post-creation (you know the category) then you can use a closure or something to conditionally show the button yes. Is this in a table builder or where is this functionality?
Bootbox is included in the admin theme so you can use that too. Here's an example of how I use the confirm function for it: https://github.com/pyrocms/accelerant-theme/blob/1.0/resources/js/theme/confirm.js