axllent/silverstripe-links-to-blank
Composer 安装命令:
composer require axllent/silverstripe-links-to-blank
包简介
Extension to add add target="_blank" to all outgoing links & downloads
关键字:
README 文档
README
This module enhances your HTML output by automatically adding target="_blank" to all outgoing links and internal "download links" (e.g., PDF, ZIP, TAR, DOC, PPT, and Excel files).
Earlier versions of this module used JavaScript for similar functionality, but that approach caused compatibility issues with tools like the Wayback Machine.
Features
- Automatically adds
target="_blank"to outgoing and internal file links. - Includes
rel="noopener"to outgoing links to prevent cross-site exploits. - Optionally adds
rel="nofollow"andrel="noreferrer"to outgoing links. - Allows adding custom CSS classes to file and external links for styling.
- Supports adding additional file extensions for custom file types.
Requirements
- Silverstripe ^4 || ^5 || ^6
Installation
composer require axllent/silverstripe-links-to-blank
After installation ensure you have done a ?flush. No further configuration is required.
Usage
To customise the module, you can define your own configuration:
Axllent\LinksToBlank\Middleware: ## Specify additional external hosts to exclude from processing. ## The current host is automatically excluded. ignore_hosts: - "www.example.com" ## Exclude links with this CSS class from being parsed (default: none). ignore_css_class: "ignore-link" ## Add a CSS class to all external links (default: none). add_css_external: "external-link" ## Add a CSS class to all file links (default: none). add_css_files: "download-link" ## Define custom file types to be treated as file links. ## Each file type should include the leading dot. add_file_extensions: - ".ext" ## Add rel="nofollow" to all external links (default: false). nofollow: true ## Add rel="noreferrer" to all external links (default: false). noreferrer: true
axllent/silverstripe-links-to-blank 适用场景与选型建议
axllent/silverstripe-links-to-blank 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.09k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2014 年 02 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「silverstripe」 「links」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 axllent/silverstripe-links-to-blank 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 axllent/silverstripe-links-to-blank 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 axllent/silverstripe-links-to-blank 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Link Field Type for Craft CMS
Set Links with a specific language parameter
Links element Silverstripe
Analytics chooser extensions for site settings.
Conversion of inactive links in the text into active clickable links
统计信息
- 总下载量: 2.09k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-02-14