[wordpress插件] Dropdown Content下拉内容

wordpress 插件 文章 2020-04-22 10:31 593 0 全屏看文

AI助手支持GPT4.0

评分
100
描述

Use a shortcode to define a drop-down form field, and shortcodes to define blocks of content that will be displayed when a specific entry is selected.

使用简码定义下拉表单字段,并使用简码定义在选择特定条目时将显示的内容块。

Usage

用法

To add a content dropdown to a post, you can either select the Content Dropdown icon from the TinyMCE editor, or enter the shortcodes manually.

要将内容下拉列表添加到帖子中,可以从TinyMCE编辑器中选择“内容下拉列表”图标,或手动输入简码。

[dropdown name="controlName" class="customClassName"] - both `name` and `class` are optional;

  [下拉名称=“ controlName” class =“ customClassName”]-名称和类都是可选的;

`name` will default to `dropdown-content`

名称将默认为下拉内容

    • the name is used to identify which content sections are targetted by this dropdown;

    • name 用于标识此下拉列表定位的内容部分;

      if there is only one dropdown on a page, it is optional;

      如果页面上只有一个下拉菜单,则为可选;

      if there are multiple dropdowns on a page, each will need a unique name

    • 如果页面上有多个下拉菜单,则每个下拉菜单都需要一个唯一的名称

    • class can be a space-separated list of class names, or just a single class name
    • class 可以是用空格分隔的类名称列表,也可以是单个类名称

    • only [dropdown-option] shortcodes may be inside this shortcode

      [dropdown-option] 短代码可能在此短代码内

      [dropdown-option value=”someValue”] – the value field is technically optional, but is required if this option is meant to make a content block visible

      [dropdown-option value =” someValue”] –技术上, value 字段是可选的,但如果此选项旨在使内容块可见,则必填

    • must be inside a [dropdown] shortcode

      必须在 [下拉菜单] 简码

      [dropdown-content name=”controlName” value=”someValue”] – if the name matches a dropdown name, and the value matches the value of an option

      [dropdown-content name =“ controlName” value =“ someValue”] –如果 name 与下拉列表名称匹配,并且 value 与选项的值匹配

      within that dropdown, then this content will be displayed when that specific option is selected.

      在该下拉菜单中,然后选择该特定选项时,将显示此内容。

    • again, name is technically optional, but must match a [dropdown] name (also defaults to dropdown-content)

      再次

      name 在技术上是可选的,但必须与 [dropdown] 名称(也默认为 dropdown-content )匹配

      >

      >

    • value is required, and must match a value for a [dropdown-option]
    • value 是必需的,并且必须与 [dropdown-option] value 相匹配

    • can be anywhere on the page
    • 可以在页面上的任何地方

    Example

    示例

    Copy and paste the following content to see the plugin in action

    复制并粘贴以下内容以查看实际使用的插件

    [dropdown]

    [下拉菜单]

    [dropdown-option]Select one…[/dropdown-option]

    [下拉选项]选择一个…[/下拉选项]

    [dropdown-option value=”option1″]First option[/dropdown-option]

    [dropdown-option value =” option1”]第一个选项[/ dropdown-option]

    [dropdown-option value=”option2″]Second Option[/dropdown-option]

    [dropdown-option value =” option2”]第二个选项[/ dropdown-option]

    [/dropdown]

    [/下拉]

    [dropdown-content value=”option1″]Content for the first option.[/dropdown-content]

    [dropdown-content value =” option1”]第一个选项的内容。[/ dropdown-content]

    [dropdown-content value=”option2″]Content for the second option.[/dropdown-content]

    [dropdown-content value =” option2”]第二个选项的内容。[/ dropdown-content]

    Those were all using the default values from the plugin.

    这些都使用了插件中的默认值。

    Let’s change it up a bit.

    让我们对其进行一些更改。

    [dropdown]

    [下拉菜单]

    [dropdown-option value=”option1″]The First[/dropdown-option]

    [dropdown-option value =” option1”]第一个[/ dropdown-option]

    [dropdown-option value=”option2″ default=true]The Second[/dropdown-option]

    [dropdown-option value =” option2” default = true]第二[/ dropdown-option]

    [dropdown-option value=”option3″]The Third[/dropdown-option]

    [dropdown-option value =” option3”]第三[/ dropdown-option]

    [/dropdown]

    [/下拉]

    You’ll notice below that the second option will be displayed by default for you.

    您会在下面注意到默认情况下将为您显示第二个选项。

    [dropdown-content value=”option1″]Some different content for the second first option.[/dropdown-content]

    [dropdown-content value =” option1”]第二个第一个选项的内容有所不同。[/ dropdown-content]

    [dropdown-content value=”option2″]Some different content for the second second option.[/dropdown-content]

    [dropdown-content value =” option2”]第二个第二个选项的内容有所不同。[/ dropdown-content]

    [dropdown-content value=”option3″]Some different content for the second third option.[/dropdown-content]

    [dropdown-content value =” option3”]第二个第三选项的内容有所不同。[/ dropdown-content]

安装步骤

The plugin is simple to install:

该插件易于安装:

    1. Download the plugin, it will arrive as a zip file
    2. 下载插件,它将以zip文件格式提供

    3. Unzip it
    4. 解压缩

    5. Upload dropdown-content.zip directory to your WordPress Plugin directory
    6. dropdown-content.zip 目录上传到您的WordPress插件目录

    7. Go to the plugin management page and enable the plugin
    8. 转到插件管理页面并启用插件

下载地址
https://downloads.wordpress.org/plugin/dropdown-content.1.0.2.zip
-EOF-

AI助手支持GPT4.0