承接 imi/magento2-top-header 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

imi/magento2-top-header

Composer 安装命令:

composer require imi/magento2-top-header

包简介

This module provides a configurable top header banner.

README 文档

README

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):

composer require imi/magento2-top-header

Then enable and register the module:

bin/magento module:enable IMI_TopHeader
bin/magento setup:upgrade
bin/magento cache:flush

If you are in production mode, also deploy static content as usual:

bin/magento setup:static-content:deploy -f

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.header before page.wrapper and renders block IMI\TopHeader\Block\BannerText with template IMI_TopHeader::topheader.phtml when imi_topheader/general/enable is true.
  • Hyvä override: src/view/frontend/layout/hyva_default.xml
    • Reuses the same block but switches template to IMI_TopHeader::hyva/topheader.phtml when using the Hyvä theme.
  • Block: IMI\TopHeader\Block\BannerText (in src/Block/BannerText.php)
    • Reads configuration values and passes them to the view. The text value is filtered via Magento's widget/template filter.

Theming

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.

统计信息

  • 总下载量: 553
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固