Runtime Only

An inputfield that renders at runtime, with no data saved to the database.

Fieldtype Runtime Only

Not a proper fieldtype because it doesn't save data to the database. The fieldtype only exists to provide a convenient way to add an inputfield to templates that will render some markup at runtime.

For a field named "my_field"...

  • Inputfield markup will be rendered from a file at /site/templates/RuntimeOnly/my_field.php. In addition to the standard ProcessWire variables this file receives:
    • $page - the page being edited.
    • $field - the Field object.
    • $inputfield - the Inputfield object.
  • JS file /site/templates/RuntimeOnly/my_field.js will be added to admin if that file exists.
  • CSS file /site/templates/RuntimeOnly/my_field.css will be added to admin if that file exists.

Tips


Output formatting

Output formatting for $page will be off in the context of Edit Page so if you want to use the formatted value of a field in your RuntimeOnly code you should use $page->getFormatted(). E.g.

$value = $page->getFormatted('some_field_name');

Repeaters

If the RuntimeOnly field is used inside a Repeater field then you can get the Repeater page it is on via $inputfield->hasPage. E.g.

$repeater_page = $inputfield->hasPage;
// Use $repeater_page as needed
echo "The name of the repeater page is $repeater_page->name";

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.
  • Auto Template Stubs

    Automatically creates stub files for templates when fields or fieldgroups are saved.
  • Custom Admin Menus

    Adds up to three custom dropdowns to the main admin menu.
  • Page List Select Multiple Quickly

    Modifies PageListSelectMultiple to allow you to select multiple pages without the tree closing.

All modules by Robin S

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