Download the PHP package helsingborg-stad/modularity without Composer
On this page you can find all versions of the php package helsingborg-stad/modularity. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download helsingborg-stad/modularity
More information about helsingborg-stad/modularity
Files in helsingborg-stad/modularity
Package modularity
Short Description Modular component system for WordPress
License MIT
Informations about the package modularity
Modularity
Modular component system plugin for WordPress. Drag and drop the bundled modules or your custom modules to your page layout.
Download plugin.
To download a complete out of the box working plugin without the need to compile or fetch dependencies.
Go here and download the full-release.zip
from the latest version.
Creating modules
To create your very own Modularity module you simply create a plugin with a class that extends our Modularity\Module class.
A module actually is the same as a custom post type. However we've added a few details to enable you to use them as modules.
Use the $this->register()
method to create a very basic module.
Here's a very basic example module for you:
Module templates
You can easily create your own module templates by placing them in: /wp-content/themes/[my-theme]/templates/module/
.
Name your template file with the following pattern: modularity-[module-id].php
. You can get your module's id from the Modularity options page.
Module boilerplate
You can download our module boilerplate. It will be a good starting point for any custom module that you would like to build.
Download it here (NOT AVAILABLE YET)
Action reference
Modularity
Runs when Modularity core is loaded. Typically used to add custom modules.
Example:
Modularity/Module/[MODULE SLUG]/enqueue
Enqueue js or css only for the add and edit page of the specified module.
Example:
Modularity/Options/Module
Action to use for adding option fields to modularity options page. Use "Modularity/Options/Save" action to handle save of the option field added
Example:
Modularity/save_block
Action triggered whenever a post or page is created or updated.
Example:
Filter reference
Modularity/Module/TemplateVersion3
Enable preview of the upcoming version 3 views with BEM formatting. This may be used already when progressing towards BEM.
Example:
Modularity/Editor/WidthOptions
Filter module width options
Params:
Example:
Modularity/Editor/SidebarIncompability
Enables the theme to add incompability indicators of specific module to an sidebar area. The user will not be able to drag and drop to unsupported areas. This filter may simplify the theme developers work by ruling out some cases.
Params:
Example:
Modularity/Display/BeforeModule
Filter module sidebar wrapper (before)
Params:
Example:
Modularity/Display/AfterModule
Filter module sidebar wrapper (after)
Params:
Example:
Modularity/Module/Container/Sidebars
Container wrapper: Filter what sidebars that should support a containing wrapper on some modules
Params:
Modularity/Module/Container/Modules
Container wrapper: Filter what modules that should support a containing wrapper
Params:
Modularity/Module/Container/Template
Container wrapper: Filter the template with html that should be wrapped around each module
Params:
Modularity/Module/TemplatePath & Modularity/Theme/TemplatePath
Modify (add/edit) paths where to look for module/theme templates Typically used for adding search path's for finding custom modules/theme templates.
Attention: Unsetting paths may cause issues displaying modules. Plase do not do this unless you know exacly what you are doing.
Params:
Example:
Modularity/Module/Classes
Modify the list of classes added to a module's main element
Params:
Example:
Modularity/Display/Markup
Module display markup
Params:
Example:
Modularity/Display/[MODULE SLUG]/Markup
Params:
Example:
Modularity/CoreTemplatesSearchTemplates
What template files to look for
Params:
Example:
Modularity/Module/Posts/Date
Modify the displayed publish date in Post Modules
Params:
Example:
Modularity/Module/Posts/Slider/Arguments
Modify the slider arguments in Post Modules
Params:
Example:
Modularity/Editor/ModuleCssScope
Allow editors to select a unique appeance (provided by a theme etc) for a module. Adds a single class to the module wrapper, to allow scoping of css styles.
Params:
Example:
Modularity/Display/viewData
Params:
Example:
Modularity/Display/{modulePostTypeSlug}/viewData
Params:
Example:
Module Attributes API
Some module features are available by setting certain attributes on the module's outmost element.
data-module-refresh-interval
Creates an interval on which the module is refreshed via XHR by calling the REST API. This attribute also requires that the data-module-id
attribute is set on the same element.
The value of the attribute should be the number of seconds on which to run the refresh interval.
Example:
Rest API
The WordPress REST API is extended with the following endpoints.
modularity/v1/modules/{id}
This endpoint returns the markup for a specific module.
- Method:
GET
- Params:
id
: The ID of the module to retrieve.
- Response: The html markup of the module.
Upgrade
In some updates, database migrations might need to be run (will be in the release docs). To run the upgrade action on all sites in a multisite network, run the following command in the document root of your site.
Or for a single site installation:
Constants
MODULARITY_DISABLE_FRAGMENT_CACHE
Disabling the built-in fragment cache means that each module's output will not be stored as an HTML cache. As a result, every time a visitor reloads the page, each module will have to be rendered again. However, it is important to consider this option only if you do not have any object cache enabled, such as Redis or Memcached. We strongly advise enabling the fragment cache feature in your application to enhance performance and caching efficiency, allowing modules to be rendered more quickly and reducing the need for repetitive rendering upon page reloads.
By defining this as true, cache will be turned off. Default: Undefined.
If enabled, each cached module will be rendered with a timestamp and cache ID in the following format:
Tested with support from BrowserStack
This software is tested with the awesome tools from Browserstack.
All versions of modularity with dependencies
composer/installers Version ~1.0
helsingborg-stad/acf-export-manager Version >=1.0.0
johannheyne/advanced-custom-fields-table-field Version dev-master
clark-nikdel-powell/post-type-select-for-acf Version dev-master
jeradin/acf-website-field Version dev-master
ooksanen/acf-focuspoint Version ^1.2.1
jeradin/acf-dynamic-table-field Version dev-master
enshrined/svg-sanitize Version dev-master
wpackagist-plugin/acf-extended Version 0.8.9.4
helsingborg-stad/acf-select-image-field Version 1.6.1
landrok/language-detector Version dev-master
league/commonmark Version 2.5.3
league/config Version 1.1.1
helsingborg-stad/wpservice Version ^2.0
helsingborg-stad/acfservice Version ^0.8.1