Page Action: Include File

A generic action allowing the selection of a PHP file containing the action code.

A generic action for Lister Pro allowing the selection of a PHP file containing the action code.

This can be useful for quickly applying API processing to pages without going to the trouble of creating a custom Page Action module for the purpose. Large quantities of pages can be processed thanks to Lister Pro's feature that splits the pages into chunks.

Usage


The module creates a folder at /site/templates/PageActionIncludeFile/ on install. Place your PHP files inside this folder. Within each file, the $item variable refers to the page that is currently being processed. There is no need to save the page within your code because Lister Pro does this automatically.

Example action file: append_foo_to_page_title.php

<?php namespace ProcessWire;
/** @var Page $item */

// Append " foo" to page title
$item->title .= " foo";

Enable the PageActionIncludeFile action in the config of one or more Lister Pro instances.

PageActionIncludeFile image 1

In the Lister Pro instance, set the filters or select the pages as needed and then choose the "Include File" action. Use the select field to choose a file you have added to /site/templates/PageActionIncludeFile/.

PageActionIncludeFile image 2

Click "Execute" to apply the action.

More modules by Robin S

  • Hanna Code Dialog

    Enhances the use of Hanna tags in CKEditor fields, including the dialog-based editing of Hanna tags.
  • Connect Page Fields

    Allows the connecting of two related Page fields so that changing one updates the other.
  • Minimal Fieldset

    Adds a config option to fieldsets to render them without label or padding in Page Edit.
  • Template Field Widths

    Quickly set the widths of inputfields in a template.
  • Custom Inputfield Dependencies

    Extends inputfield dependencies so that inputfield visibility or required status may be determined at runtime by selector or custom PHP code.
  • Breadcrumb Dropdowns

    Adds dropdown menus of page edit links to the breadcrumbs in Page Edit.
  • Custom Admin Menus

    Adds up to three custom dropdowns to the main admin menu.
  • Auto Template Stubs

    Automatically creates stub files for templates when fields or fieldgroups are saved.
  • Auto AVIF

    Automatically generates AVIF files when image variations are created.

All modules by Robin S

Install and use modules at your own risk. Always have a site and database backup before installing new modules.