Valery Posted April 3, 2021 Share Posted April 3, 2021 Hello everybody! One of my clients seems to be using the extra page actions a lot, and he is rather that they are visible to him without clicking the "extras" icon (">") to expand. So I decided I'd throw a couple of hooks to add some extra page actions to the regular page actions, so that they become instantly accessible without the need to expand the extras. Here's a fragment of code from my /site/ready.php I was trying to use a global variable to store the extra actions array but I don't seem to be able to use it in the second hook. /* * A couple of hooks to add page action * "unpub" to the list of non-ajax page actions * alongside with "new", "edit" etc * */ wire()->addHookAfter("ProcessPageListActions::getExtraActions", function($event) { global $extraActions; $extraActions = $event->return; }); wire()->addHookAfter("ProcessPageListActions::getActions", function($event) { $actions = $event->return; global $extraActions; $actions['unpub'] = $extraActions['unpub']; $event->return = $actions; }); Somehow var_dump(extraActions) keeps giving me a NULL. I don't really think I should develop a whole module just to change the list of page actions; I just need the extras to be immediately visible without the click. Could you please help me out? Any hints or solutions are more than welcome! Link to comment Share on other sites More sharing options...
Robin S Posted April 5, 2021 Share Posted April 5, 2021 On 4/4/2021 at 6:27 AM, Valery said: I just need the extras to be immediately visible without the click AdminOnSteroids has an option in the PageListTweaks section: "Always show extra actions" 1 Link to comment Share on other sites More sharing options...
Valery Posted April 6, 2021 Author Share Posted April 6, 2021 Thank you, Robin S! That was exactly what I was looking for ? 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now