Download the PHP package imi/magento2-top-header without Composer
On this page you can find all versions of the php package imi/magento2-top-header. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download imi/magento2-top-header
More information about imi/magento2-top-header
Files in imi/magento2-top-header
Package magento2-top-header
Short Description This module provides a configurable top header banner.
License MIT
Informations about the package magento2-top-header
IMI Top Header — Magento 2 Module
A lightweight Magento 2 module that renders a configurable banner at the very top of every page. The banner can be enabled/disabled per scope and its text and colors can be customized from the Admin. Both Luma and Hyvä compatible.
Requirements
- Magento 2.4.x
Installation
Install via Composer (recommended):
Then enable and register the module:
If you are in production mode, also deploy static content as usual:
Configuration
Navigate to: Stores > Configuration > iMi > Top Header.
Scope support: Global, Website, Store View.
Available options:
imi_topheader/general/enable— Enable/disable the banner (Yes/No)imi_topheader/general/text— Banner text (supports HTML; processed through Magento's template filter)imi_topheader/general/text_color— Text color (hex or valid CSS color)imi_topheader/general/background_color— Background color (hex or valid CSS color)
How it works (entry points)
- Registration:
src/registration.php - Layout injection:
src/view/frontend/layout/default.xml- Adds a container
top.headerbeforepage.wrapperand renders blockIMI\TopHeader\Block\BannerTextwith templateIMI_TopHeader::topheader.phtmlwhenimi_topheader/general/enableis true.
- Adds a container
- Hyvä override:
src/view/frontend/layout/hyva_default.xml- Reuses the same block but switches template to
IMI_TopHeader::hyva/topheader.phtmlwhen using the Hyvä theme.
- Reuses the same block but switches template to
- Block:
IMI\TopHeader\Block\BannerText(insrc/Block/BannerText.php)- Reads configuration values and passes them to the view. The
textvalue is filtered via Magento's widget/template filter.
- Reads configuration values and passes them to the view. The
Theming
- Luma/Blank and similar themes: template
src/view/frontend/templates/topheader.phtmlis used by default. - Hyvä theme: template
src/view/frontend/layout/hyva_default.xml.
You can customize the look by overriding the corresponding PHTML in your theme, or by adjusting the configuration colors.
License
This project is licensed under the MIT License. See the LICENSE file for details.