Robin S Posted September 29, 2022 Share Posted September 29, 2022 This might be a somewhat niche module but I had a need for it and maybe others will also find it a useful development helper. Lister To Clipboard Easily copy a selector for the current Lister filters or selected results to the clipboard. For superusers only. Why? Lister or Lister Pro is handy for finding pages according to certain page attributes or field values and you can see the matched pages in a results list. Sometimes I want to run code on some or all the Lister results. Lister Pro allows results to be processed through Page Action modules but there are a couple of downsides to this: To execute custom code you would have to create a custom Page Action module and this may not be worth the trouble for a one-off operation. If you want to process only selected individual pages you can only select items from one page of the results. If you navigate to a different page within the paginated results the selection is lost. Lister To Clipboard gives you an easy way to copy a selector for the current Lister filters or a selection within the results so you can paste it into the Tracy Debugger Console or use it elsewhere in your code. Usage In Lister (Find) or in a Lister Pro instance, create filters to match the pages you want to target. If you want to select individual pages within the results, click an empty area of the cell within the first column (i.e. don't click directly on the page title). The cell will get a green background to indicate that it is selected. If there is more than one page of results you can move around the pagination to select more pages. Below the Lister results there is a blue box showing a selector string that will find the pages shown in your Lister results (or your selection within those results) when used in $pages->find(). Click the copy icon to copy the selector to the clipboard, then you can paste it into the Tracy Debugger Console or wherever you want to use it. https://github.com/Toutouwai/ListerToClipboardhttps://processwire.com/modules/lister-to-clipboard/ 5 Link to comment Share on other sites More sharing options...
szabesz Posted September 29, 2022 Share Posted September 29, 2022 40 minutes ago, Robin S said: useful development helper It is useful for sure! Thanks for sharing! One quick observation: Could you please consider placing the output of the module under the "Add New" button instead (along with some margin-top)? Link to comment Share on other sites More sharing options...
Robin S Posted September 29, 2022 Author Share Posted September 29, 2022 @szabesz, the output can't go below the button because the button is not in the results area. But I added a bottom margin so there is some separation from the button. 1 Link to comment Share on other sites More sharing options...
szabesz Posted September 30, 2022 Share Posted September 30, 2022 @Robin S Thank you! 1 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