All Projects → charliedevelopment → craft3-blockonomicon

charliedevelopment / craft3-blockonomicon

Licence: other
Manage matrix fields on a per-block basis. Bundle presentation with blocks. Render entire matrices with a single line.

Programming Languages

PHP
23972 projects - #3 most used programming language
HTML
75241 projects
CSS
56736 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to craft3-blockonomicon

Spoon
Spoon plugin for Craft CMS - Enhance your Matrix fields with groups, tabs and more!
Stars: ✭ 82 (+156.25%)
Mutual labels:  matrix, craftcms, craft3
Keycloak Config Cli
Import YAML/JSON-formatted configuration files into Keycloak - Configuration as Code for Keycloak.
Stars: ✭ 147 (+359.38%)
Mutual labels:  export, import
Dynein
DynamoDB CLI written in Rust.
Stars: ✭ 126 (+293.75%)
Mutual labels:  export, import
Sketchup Stl
A SketchUp Ruby Extension that adds STL (STereoLithography) file format import and export.
Stars: ✭ 214 (+568.75%)
Mutual labels:  export, import
Process Migrator
Process migrator node.js utility for VSTS inherited process
Stars: ✭ 49 (+53.13%)
Mutual labels:  export, import
Grafana Import Export
shell scripts for importing and exporting Grafana's dashboards and datasources
Stars: ✭ 125 (+290.63%)
Mutual labels:  export, import
craft-router
A Craft CMS plugin for using URL segments as filtering criteria on an entry query.
Stars: ✭ 21 (-34.37%)
Mutual labels:  craftcms, craft3
Lazy importer
library for importing functions from dlls in a hidden, reverse engineer unfriendly way
Stars: ✭ 544 (+1600%)
Mutual labels:  export, import
Portphp
Data import/export framework for PHP
Stars: ✭ 225 (+603.13%)
Mutual labels:  export, import
craft3-collections
Clean up those complex templates with Laravel Collections
Stars: ✭ 24 (-25%)
Mutual labels:  craftcms, craft3
Fbx
📜 Single-file binary FBX importer.
Stars: ✭ 47 (+46.88%)
Mutual labels:  export, import
cassandra-exporter
Simple Tool to Export / Import Cassandra Tables into JSON
Stars: ✭ 44 (+37.5%)
Mutual labels:  export, import
Bentools Etl
PHP ETL (Extract / Transform / Load) library with SOLID principles + almost no dependency.
Stars: ✭ 45 (+40.63%)
Mutual labels:  export, import
Couchimport
CouchDB import tool to allow data to be bulk inserted
Stars: ✭ 125 (+290.63%)
Mutual labels:  export, import
Elasticsearch Dump
Import and export tools for elasticsearch
Stars: ✭ 5,977 (+18578.13%)
Mutual labels:  export, import
Csvreader
csvreader library / gem - read tabular data in the comma-separated values (csv) format the right way (uses best practices out-of-the-box with zero-configuration)
Stars: ✭ 169 (+428.13%)
Mutual labels:  export, import
Npoi.mapper
Use this tool to import or export data with Excel file. The tool is a convention based mapper between strong typed object and Excel data via NPOI.
Stars: ✭ 348 (+987.5%)
Mutual labels:  export, import
Simple Excel
Read and write simple Excel and CSV files
Stars: ✭ 502 (+1468.75%)
Mutual labels:  export, import
Dataset Serialize
JSON to DataSet and DataSet to JSON converter for Delphi and Lazarus (FPC)
Stars: ✭ 213 (+565.63%)
Mutual labels:  export, import
open2fa
Two-factor authentication app with import/export for iOS and macOS. All codes encrypted with AES 256. FaceID & TouchID support included. Written with love in SwiftUI ❤️
Stars: ✭ 24 (-25%)
Mutual labels:  export, import

Blockonomicon

Blockonomicon for Craft 3

This plugin enhances Craft's own matrix fields with a number of features:

  • Individual matrix block configurations can be imported and exported, allowing for easy duplication without having to manually edit, even across entire Craft installations.
  • Matrix block configurations can be bundled with HTML, CSS, and JS. These bundles allow a block to have a consistent layout, appearance, and behavior on the frontend of a Craft site.
  • Optional ease of use functions for templates to allow rendering matrix blocks by their associated HTML in a single command.
  • The ability to sort blocks alphabetically with a single click.
  • Data is still stored in a Craft Matrix field. You can choose to uninstall Blockonomicon at any time without losing access to your data.

Requirements

  • Craft CMS 3.0.0-RC6 or above

Installation

  1. Open a terminal and navigate to your project folder:
cd /path/to/project
  1. Require the package to download it via Composer:
composer require charliedev/blockonomicon
  1. Install the plugin on the Settings -> Plugins page in the Craft control panel.

--- or ---

  1. Install the plugin via the command line:
./craft install/plugin blockonomicon

What are Blocks?

If you are familiar with Craft, you have no doubt seen the Matrix field in action. Each of its repeatable sets of fields is called a block. You can think of Blockonomicon's blocks as one and the same, with one main extension:

In Blockonomicon, a matrix block may be exported from a matrix field. These exported blocks, while they may be bundled with other configuration and templating files, are no different from their matrix counterparts.

Usage

Block Management

Blockonomicon block overview panel

Blockonomicon's strongest feature is its ability to export and import block configurations. To do this, go to the Blocks subsection of the Blockonomicon control panel. From here you can see the block overview section, which a listing of all exported blocks for quick reference. In the sidebar, matrix fields are listed, and choosing one will bring you to its respective editor. If an individual block needs a name or description update, there is a simple block editor that can be accessed through the edit icon of any block displayed. If there is a configuration issue with any of the installed blocks (missing configuration, bad formatting, etc.), there will be a notification in this panel as to what blocks are having trouble.

Matrix Editing

Blockonomicon matrix editor panel

Selecting a matrix will shows the matrix editor containing a list of both the blocks already attached to the matrix and blocks that can be imported. In the matrix editor, blocks can be freely reordered, new ones may be imported into the matrix, and existing ones may be exported. Each block has an indicator as to whether or not it exists on the matrix, has a corresponding exported configuration file, and even if the block's configuration matches the current configuration file.

Exporting

Exporting a block saves the block's configuration to a file, and additionally creates a bundle of HTML, CSS, and JS files to go along with the block. When exporting a block that already has been exported, the configuration is backed up (as a separate json.bak file), and then the configuration is overwritten. Additional bundle files are not regenerated if they do not exist.

Importing

Importing a block creates a new block on the matrix being edited, using the fields and their respective settings from the configuration file. If being imported over an existing block, Blockonomicon will use each fields' handle to create new fields, update settings for fields that have changed, and delete any fields that no longer exist.

Block Editing

Blockonomicon block editor panel

From the block overview, clicking the edit icon will bring you to the block editor. Provided here is a simple reference to the fields that are associated with the block, as well as a means of editing a block's name, handle, and description. To fully edit a block's individual field configurations, it is best to use the built-in matrix editor of Craft, and then re-export the (new) block. If you're feeling exceptionally adventurous, the JSON block configuration files can be manually edited.

Bundles and Templating

By default, blocks are saved to Craft's own storage folder, though this setting can be changed (see Advanced Settings below). These bundles provide not only the block's field configuration (in a json file), but also a set of HTML, CSS, and JS that may be reused alongside each block. When a block is first exported, placeholder files for these resources are created.

To use these resources in frontend templates, there are a few convenience methods you can use.

For example, if you have a matrix field as part of your current entry called myMatrixField, you could render each matrix block in order, using its own bundled HTML template, with the following Twig tag:

{{ craft.blockonomicon.renderMatrix(entry.myMatrixField) }}

This will search for templates of exported blocks, based on each block's handle. When these templates are rendered, the block Twig variable is set to that block from the matrix being rendered. This means if your myMatrixField has as header plain text field, you can display it in your block template with the following:

{{ block.header }}

It is possible that your blocks not only have a specific template, but also specific styling and scripting you want to use with it across a site, or even port across Craft installations. With the included CSS and JS files, these bundles can be isolated and portable. In order to generate the <link> tags for CSS or <script> tags for JS the following Twig can be used:

{{ craft.blockonomicon.renderCSS(options) }} {{ craft.blockonomicon.renderJS(options) }}

By default, individual <link> and <script> tags are generated for each block, which can be useful for active development. To merge all of the block style and script files together into single JS or CSS files, pass {condense: true} as the options for each of these functions.

Default Bundle Files

If you need to adjust the bundled files generated by Blockonomicon, the templates used will be stored in Craft's storage/blockonomicon folder. The Twig template used to generate each block's HTML, CSS, and JS on export are called base.html, base.css, and base.js respectively.

Bundle Security

Keep in mind, Blockonomicon requires JSON and HTML block files to be prefixed with an underscore. This prefix causes Craft to prevent these files from being retrieved directly from the frontend.

Custom Fields

Blockonomicon supports all native Craft fields. Many third party fields may also be supported out of the box. An unsupported field does not prevent a block from being exported or imported. Instead if all settings cannot be saved, it may not match the exported configuration entirely when imported. Instead, for more complex fields, Blockonomicon provides an extension system that allows adapters to support these more complex fields. This extension system is used internally for Craft's element fields (Asset, Category, Entry, Tag, User).

An example of an extension that allows a more complex field to be imported/exported is the Blockonomicon Super Table Adapter

Advanced Settings

Blockonomicon settings panel Blockonomicon has special configuration settings available by editing the blockonomicon.php file under Craft's config folder. The settings panel can be used to confirm and review these settings.

allowedUsers

If set, users listed here (by id), are the only ones allowed to access Blockonomicon within the control panel. This is for those Craft installs where some users are admins or otherwise have permissions that would allow them access to the Blockonomicon panel, but should still be restricted.

blockStorage

This changes Blockonomicon's block configuration and template export location to a different local folder. Keep in mind that this path is registered as a template root, and files within it may be accessed through the /blockonomicon path on the frontend.

In-Plugin Examples

Blockonomicon examples panel

For developer reference, Blockonomicon allows the installation of a set of example templates and data. Listed in the examples section is a breakdown of all data installed with the example content.


Built for Craft CMS by Charlie Development

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].