plenta/contao-tooltip-bundle

Tooltip Bundle

1.0.0 2023-12-05 13:07 UTC

This package is auto-updated.

Last update: 2024-09-14 13:10:01 UTC


README

轻松获取作为工具提示/模态弹出/对话框的额外信息
在许多元素旁边添加工具提示/模态对话框

元素将通过ajax加载。

直接从源代码复制生成的插入标签到剪贴板,将其放在您想要的位置。

示例: {{plenta_tooltip::alias}}

安装

使用 Contao Manager 安装

搜索 tooltipdialogmodal,您将找到此扩展。

使用 Composer 安装

composer require plenta/contao-tooltip-bundle

系统要求

  • PHP: ^7.4 || ^8.0
  • Contao: ^4.13(适用于 Contao 5 的后续版本)

设置

模态弹出宽度配置

从工具提示选项中提供的各种预定义最大宽度设置中选择。此外,您还可以通过调整 config.yml 文件来灵活地添加自定义大小。

# Predefined <dialog> sizes
plenta_tooltip:
    tooltip_sizes:
        small:
            cssClass: tooltip-small
        medium:
            cssClass: tooltip-medium
        large:
            cssClass: tooltip-large

每个预定义的工具提示大小对应一个特定的CSS自定义属性,这为您的设计提供了无缝集成。

:root {
    --plenta-tooltip-max-width-large: 1280px;
    --plenta-tooltip-max-width-medium: 680px;
    --plenta-tooltip-max-width-small: 380px;
    --plenta-tooltip-max-width-default: var(--plenta-tooltip-max-width-medium);
}

资源集成

为了轻松将插件集成到您的项目中,提供了最少的CSS和JavaScript文件。这些文件在插入标签替换过程中加载。CSS文件将样式追加到 $GLOBALS['TL_CSS']['plenta_tooltip'] 变量中,而JavaScript文件将代码追加到 $GLOBALS['TL_BODY']['plenta_tooltip_js'] 变量中。

Contao tooltip rxample

Popup example