定制 mostlyserious/craft-markerio 二次开发

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

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

mostlyserious/craft-markerio

最新稳定版本:2.2.0

Composer 安装命令:

composer require mostlyserious/craft-markerio

包简介

Easily add Marker.io to your CraftCMS site.

README 文档

README

Easily integrate Marker.io with CraftCMS.

Marker.io is the preferred QA tool of the Mostly Serious dev team. This plugin allows you to add their reporting widget to both the front and back end of a Craft site, making it easy for users to report issues.

Requirements

This plugin requires Craft CMS 4.9.0 or later, and PHP 8.0.2 or later.

Installation

You can install this plugin from the Plugin Store or with Composer.

From the Plugin Store

Go to the Plugin Store in your project’s Control Panel and search for “Marker.io”. Then press “Install”.

With Composer

Open your terminal and run the following commands:

# go to the project directory
cd /path/to/my-project.test

# tell Composer to load the plugin
composer require mostlyserious/craft-markerio

# tell Craft to install the plugin
./craft plugin/install markerio

Usage

  • Sign up for an account at Marker.io and copy your Project ID.
  • Add your Project ID to the plugin settings.

That's it! You can configure the widget further using the settings provided. All config settings can be overridden with a marker.php in your config folder.

<?php

use craft\helpers\App;

/* Example /config/markerio.php */

return [
    'project' => App::env('YOUR_ENV_VAR_HERE'),
    'enableWidgetFe' => true,
    'enableWidgetCp' => true,
    'requireLogin' => false,
    'silent' => false,
    'renderDelay' => 1200,
    'keyboardShortcuts' => false,
    'useNativeScreenshot' => false,
    'extension' => false,
];

The plugin automatically add the Marker.io widget in the <head> for you.

Variables and Advanced Configuration

If you require advanced features such as Reporter Identification or Custom Metadata, or if you prefer to add the Marker.io widget to your templates manually, you may use the following variables in Twig templates:

{{ craft.markerio.project }}
{# The project id, ex: "369ajJu************" #}

{{ craft.markerio.markerConfig }}
{# The configuration data as an associative array, ex. '{{ craft.markerio.markerConfig.project }}' #}

{{ craft.markerio.markerConfigScript|raw }}
{# The configuration script, ex 'window.markerConfig = { ... }' including your config settings (no script tag). #}

{{ craft.markerio.widgetShim|raw }}
{# The Marker.io width shim, ex '!function(...' with no script tag. #}

When rendering the widget manually, be sure to disable the widget on the front end in your config settings.

return [
    'enableWidgetFe' => false,
    // ...
];

You will also need to manage your own requireLogin logic when rendering the widget manually.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2024-05-31