Download the PHP package semexpert/module-store-info-blocks without Composer
On this page you can find all versions of the php package semexpert/module-store-info-blocks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download semexpert/module-store-info-blocks
More information about semexpert/module-store-info-blocks
Files in semexpert/module-store-info-blocks
Package module-store-info-blocks
Short Description Enables developers to include Magento blocks in their themes that have access to Store Configuration like address, phone number, etc.
License MIT
Informations about the package module-store-info-blocks
SemExpert_StoreInfoBlocks
SemExpert_StoreInfoBlocks enables developers to include Magento blocks in their themes that have access to Store Configuration like address, phone number, etc.
Getting Started
To get started you only need to add the module to an existing Magento2 installation.
Prerequisites
You need a running copy of Magento2
Also, in order for composer to locate the module repository, you need to have set up SemExpert repository:
Install
To get StoreInfoBlocks up and running, you need to add it as a dependency to your Magento composer.json file
Or add it manually to your composer.json
After installing, you need to enable via the Magento CLI
Running tests
This module provides only unit tests that can be hooked into Magento testsuite in the standard way
In order to run this module's tests exclusively you can use the provided dev/phpunit.xml
configuration file.
I found no need for integration or functional tests as of yet. And also I am unsure about how to write those.
Coding Styles
The module follows Magento 2.2 PHP and Less coding standards. You should test your code using the provided black/white lists and phpunit.xml configuration.
Magento 2
Components
The module provides 2 types of blocks
SemExpert\StoreInfoBlocks\Block\Template
Provides a stadard Template block with access to store configuration informationSemExpert\StoreInfoBlocks\Block\Value
Allow to output a single configuration value without formatting. Requires some setup via layout xml
These blocks are available for use in your custom themes but are not automatically included anywhere on the site.
Usage
Template
By simply calling the Template block in a layout, the provided storeinfo.phtml template will be used which is provided only as an example
or you can provide your own template. Within the template, you can access a DataObject containing the store information
by calling $block->getStoreInformation()
default.xml
storeinfo-modal-window.phtml
Available data keys are:
- name
- phone
- hours
- street_line1
- street_line2
- city
- postcode
- region_id
- region
- country_id
- country
- vat_number
Value
You can set up a value block via layout XML to retrieve a single unformatted value
contact_index_index.xml
app/design/SemExpert/CustomTheme/Magento_Contact/templates/form.phtml
Check the description for Template block for a list of accepted values for the key
argument.
Versioning
We use SemVer for versioning. To see available versions, check the tags for this repository.
Authors
- Matías Montes - Initial work - barbazul
Also check the list of contributors who participated in this project.
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Acknowledgments
- Thanks to everybody involved in this thread that served as an inspiration for the module.
- alepasian and lupeportias for hacking your way into M2 limitations.