Create modules by creating classes in /modules/
.
Enable screenshots and descriptions of modules when clicking "Add a Module".
Enable "Global Modules" (WIP).
Enable inline editing of flexible modules.
Enable module preview in admin.
Return an array of module names here to enable them as global modules.
Return a $value
from here to use that value when rendering the field with dummy data.
Filter the ACF fields for modules before they're added. This allows you to add "global" fields to several modules at once.
TODO...
Render module $module
using (optional) fields $fields
(or ACF location like a term, options page or set to null
to fetch fields from get_the_ID()
) using (optional) template $template
.
Render flexible modules contained in flexible content area $area
using (optional) $id
as ACF location.
Fetch ACF fields for all $modules
and use layout $layout
(tabs
, accordion
, normal
or flexible
). Optionally give every module group a Template
dropdown using $withTemplates = true
.
Render all $modules
using dummy data.
Extend this class to create a module.
This method is called once on every page load. It allows you to add hooks or do whatever you like related to your module. Note that it runs whether or not the module is used on the current page.
Return an array of ACF fields from here and they will be added to the module.
Return an array from here and each array property will be available in the module template.
Return the value of any field returned from fields()
. Useful inside data()
to check module configuration.