Jump to content
Leftfield

How to add a "favorite" to PageListActions

Recommended Posts

Hi @All

I am trying to add an link to field "favorite" (checkbox) in the backend in the row "Edit, New, View... Favorite", A link should imitate the field favorite and when you click on it, it should check/uncheck field without editing the page.
I assume there is a solution on the forum, but after wide search, couldn't find it. Tried to add it in "List of fields to display in the admin Page List" but you cant check it without editing the page.

PW: 3.0.146
PHP: 7.3.5

Capture.PNG

Share this post


Link to post
Share on other sites

I've never tried to add a custom page list action myself, but it definitely seems possible, since it's hookable. I've found a few forum threads that could get you on the right track:

https://processwire.com/talk/topic/10254-custom-page-actions/

https://processwire.com/talk/topic/2203-right-hook-right-after-the-pagelistactions/

https://processwire.com/talk/topic/14235-added-custom-action-but-it-doesnt-do-nothing/

 

  • Like 1

Share this post


Link to post
Share on other sites

Hi,

here is ProcessPageToggle module and it is almost the same like @dragan post link to another forum thread, or what can be found inside Processwire Copy/Clone module.
This is basic variant and need to be configured inside file, as example:
 

// ProcessPageToggle.module

// set action button label
protected $actionLabel = 'Favorite';
// set page template(s)   
protected $templates = array('blog');
// set page checkbox field name    
protected $targetField = 'favorite';

toggle.thumb.gif.4bcc44b5674d25972517e1e5d4a2b726.gif

Download, edit, and install like any other PW module.

ProcessPageToggle.module

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...