承接 networkteam/neos-selectivemaintenance 相关项目开发

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

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

networkteam/neos-selectivemaintenance

Composer 安装命令:

composer require networkteam/neos-selectivemaintenance

包简介

Enable maintenance mode for specific documents in your page tree.

README 文档

README

Enable maintenance mode for specific documents in your page tree.

Installation

Add this package to composer.json of your site package.

cd Packages/Sites/Your.Site
composer require networkteam/neos-selectivemaintenance --no-update

Run node migration for adding default values.

flow node:migrate 20230216214800 --confirmation true

Configuration

This package provides a processor for which replaces the common content with maintenance content. First of all you have to decide, at which position of your sites layout you'd like to render the maintenance content. Some examples are:

  • Replacing complete body
  • Replacing main content only, for still showing navigation and footer

Take a look into the Neos demo package. It provides several page types. Some of them are:

  • Page
  • Landingpage
  • Chapter
  • Base

Replacing complete body

If you would like to replace the complete body for a page being in maintenance, add the processor to base document (Neos.Demo:Document.Base)

Packages/Sites/Neos.Demo/Resources/Private/Fusion/Document/Base.fusion

/**
 * Prototype to render a page with all scripts and styles but with
 * a replaceable body and bodyClass via props
 */
prototype(Neos.Demo:Document.Base) < prototype(Neos.Fusion:Component) {
    body = null
    bodyClass = null

    renderer = Neos.Neos:Page {
        head {
            stylesheets {
                site = Neos.Demo:Document.Fragment.StyleSheets
            }
            javascripts {
                site = Neos.Demo:Document.Fragment.JavaScripts
            }
            metadata = Neos.Demo:Document.Fragment.MetaData
        }

        bodyTag.attributes.class = ${props.bodyClass}
        body = ${props.body}
+       body.@process.maintenaceContent = Networkteam.Neos.SelectiveMaintenance:MaintenanceContent 
    }
}

Replacing main content only

For replacing main content only, you'll have to adjust each document separately.

Add the processor to the mainContent property. The example below shows the default page. Some procedure applies to the other documents.

Packages/Sites/Neos.Demo/Resources/Private/Fusion/Document/Page.fusion

/**
 * Default page-rendering for the Neos.Demo website
 */
prototype(Neos.Demo:Document.Page) < prototype(Neos.Fusion:Component) {
    mainMenu = Neos.Demo:Document.Fragment.Menu.Main
    secondaryMenu = Neos.Demo:Document.Fragment.Menu.Secondary
    metaMenu = Neos.Demo:Document.Fragment.Menu.Meta
    breadcrumbMenu = Neos.Demo:Document.Fragment.Menu.Breadcrumb
    languageMenu = Neos.Demo:Document.Fragment.Menu.Language

    mainContent = Neos.Demo:Document.Fragment.Content.Main
+   mainContent.@process.maintenanceContent = Networkteam.Neos.SelectiveMaintenance:MaintenanceContent
    footerContent = Neos.Demo:Document.Fragment.Content.Footer

    bodyClass = ${q(node).parents().count() >= 1 && q(node).children('[instanceof Neos.Neos:Document]').filter('[_hiddenInIndex=false]').count() > 0 ? 'has-subpages' : null}

    renderer = Neos.Demo:Document.Base {
        bodyClass = ${props.bodyClass}
        body = afx`
            <div class="top-navigation-wrap navbar-fixed-top">
                <div class="container">
                    {props.languageMenu}
                    {props.mainMenu}
                    {props.secondaryMenu}
                </div>
            </div>

            <div class="container">
                {props.breadcrumbMenu}
                {props.mainContent}
            </div>

            <footer role="navigation" class="navbar navbar-default">
                <div class="panel panel-default">
                    <div class="panel-body clearfix">
                        <div class="container">
                            {props.metaMenu}
                        </div>
                    </div>
                    <div class="panel-footer">
                        <div class="container">
                            {props.footerContent}
                        </div>
                    </div>
                </div>
            </footer>
        `
    }
}

Usage

  1. Create a page with maintenance information in your page tree, somewhere.
  2. Select the page which should be in maintenance mode.
  3. Enable maintenance mode and set previously created page as maintenance page

networkteam/neos-selectivemaintenance 适用场景与选型建议

networkteam/neos-selectivemaintenance 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.51k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 02 月 17 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 networkteam/neos-selectivemaintenance 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 networkteam/neos-selectivemaintenance 我们能提供哪些服务?
定制开发 / 二次开发

基于 networkteam/neos-selectivemaintenance 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-17