定制 thesceneman/silverstripe-glossary 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

thesceneman/silverstripe-glossary

最新稳定版本:2.0.0

Composer 安装命令:

composer require thesceneman/silverstripe-glossary

包简介

Adds a Glossary section to CMS admin where glossary terms can be defined. These terms can then be added to content via the WYSIWYG and the definitions will be rendered as interactive rollovers within webpage content.

README 文档

README

Adds a Glossary section to CMS admin where glossary terms can be defined. These terms can then be added to content via the WYSIWYG and the definitions will be rendered as interactive rollovers within webpage content.

Thanks to @MelissaWu-SS for writing the code that was the basis for this module

Requirements

version ^2

  • Silverstripe ^6
  • PHP ^8.3

version ^1

  • Silverstripe ^5

version ^0.2

  • Silverstripe ^4.0
  • PHP ^7.3

Installation

composer require thesceneman/silverstripe-glossary

Usage

After running composer run the usual vendor/bin/sake dev/build

This will add the Glossary section to the CMS admin:
Glossary admin

Here we can add glossary terms via standard gridfield. I've added some sample data in this example:
Glossary admin data

Now, we can add these terms to our WYSIWG markup. Select the word you'd like to apply the definition to, click the "Glossary" button, and choose the appropriate definition:
Adding glossary term to markup
Selecting glossary term

And finally here is the marked up content on a webpage (displayed at cursor hover state):
Glossary frontend

Customising the frontend

NB. With the release of v0.2.0 the Definition field on GlossaryTerms was changed from Varchar to HTMLText. The simple CSS only frontend implementation renders this as plaintext (in order to be rendered within span tags) so no markup will be carried to the frontend.

This module comes with a very basic frontend implementation out of the box and you'll likely want to change this to match your application. You may opt to keep the purely CSS rollover functionality and write some new CSS for the classes .inline-glossary-term and .inline-glossary-definition.

Alternatively you can overload the template at TheSceneman\SilverStripeGlossary\View\GlossaryShortcodeProvider.ss and use whatever markup and or Javascript components you'd like.

Maintainers

Development and contribution

If you would like to make contributions to the module please ensure you raise a pull request and discuss with the module maintainers.

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2022-01-06