lucasbares/craft-emailobfuscator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

lucasbares/craft-emailobfuscator

Composer 安装命令:

composer require lucasbares/craft-emailobfuscator

包简介

A simple plugin that adds a twig tag to obfuscate email addresses (by rot13) in text fields.

README 文档

README

A simple plugin that adds a twig tag to obfuscate email addresses (by ROT13) in text fields.

Plugin Logo

Requirements

This plugin is made for Craft CMS 3.0.0-beta.23 or later. It requires the Email-Obfuscator by Propaganistas since this plugin is merely a wrapper for his Twig Extension.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
    
  2. Then tell Composer to load the plugin:

     composer require lucasbares/craft-emailobfuscator
    
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Craft Emailobfuscator.

You can also update your craft's composer.json file and run composer update.

Using the Plugin

This plugin adds the Twig Extension made by Propaganistas to Craft. It masks all email addresses by ROT13 ciphering or CSS reverse text direction. A simple javascript file decodes the masked emails on the frontend.

To use it, just use the obfuscateEmail Twig filter on any text field or string:

{{ "Sample Text"|obfuscateEmail }}
{{ textfield|obfuscateEmail }}

Configuring the Plugin

InludeJS

By default the plugin inserts the necessary JavaScript to your front end html. There is a setting to turn this off if you want to include the JS code manually. The relevant JS code is available at https://github.com/Propaganistas/Email-Obfuscator/tree/master/assets

Craft 4 - Migration to Craft-Obfuscator

Unfortunately, I will not update this plugin for Craft 4. @Miranj has a plugin with almost the same functionality. To use it with the same twig filters and make the transition more easy, I wrote a small module which you can install.

Install migration module

  1. Copy the migration module into craft/modules
  2. Uninstall this plugin :( and install Craft-Obfuscator
  3. Update your site to Craft 4
  4. Update your composer.json to autoload the module (see example file in folder) and run composer dump-autoload -a
  5. Now your templates should work againg ;)

Credits

  • Propaganistas for developing this great Twig Extension
  • nystudio107 for providing great articles on Craft3 plugin development

Brought to you by Lucas Bares

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-03-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固