[wordpress插件] CSV to SortTableCSV到SortTable

wordpress 插件 文章 2020-04-06 10:30 459 0 全屏看文

AI助手支持GPT4.0

评分
98
描述

CSV to SortTable is great for anyone who wants to display information from a spreadsheet on a WordPress website.

将CSV转换为SortTable的功能非常适合希望在WordPress网站上显示电子表格信息的用户。

This plugin can be used to display product catalogs, inventory lists, leaderboards or anything else that can be stored in a CSV file.

此插件可用于显示产品目录,库存清单,排行榜或可以存储在CSV文件中的任何其他内容。

How To Use

使用方法

Insert a sortable table into any page or post using this shortcode:

使用此短代码将可排序表格插入任何页面或帖子:

[csv src=http://example.com/myfile.csv]

  [csv src = http://example.com/myfile.csv]

The result will be a beautiful, semantically-correct HTML table populated with the contents of your file.

结果将是一个漂亮的,语义正确的HTML表,其中填充了文件的内容。

Optional Features

可选功能

This plugin automatically does a few things for you, all of which can be disabled:

此插件会自动为您执行一些操作,所有这些操作都可以禁用:

    1. Adds some CSS to make the table look nice.
    2. 添加一些CSS以使表看起来更漂亮。

    3. Converts image file URLs into clickable image links.
    4. 将图像文件URL转换为可点击的图像链接。

    5. Converts certain file URLs into clickable file-type icons (.doc, .pdf, .ppt, .xls, .zip).
    6. 将某些文件URL转换为可点击的文件类型图标(.doc,.pdf,.ppt,.xls,.zip)。

    To disable any of these features, use the disable shortcode attribute:

    要禁用任何这些功能,请使用 disable shortcode属性:

    [csv src=http://example.com/myfile.csv disable=css]

      [csv src = http://example.com/myfile.csv disable = css]

    [csv src=http://example.com/myfile.csv disable=icons,images]

    [csv src = http://example.com/myfile.csv disable = icons,images]

    [csv src=http://example.com/myfile.csv disable=all]

    [csv src = http://example.com/myfile.csv disable = all]

    The first example would disable only the plugin CSS;

    第一个示例将仅禁用插件CSS;

    the second would disable both the file-type icons and image links;

    第二个将禁用文件类型图标和图像链接;

    and the third would disable all optional features.

    第三个将禁用所有可选功能。

    Disable any combination using a comma-separated list (no spaces!).

    使用逗号分隔的列表禁用任何组合(不能使用空格!)。

    Table ID

    表格ID

    Want to give your table a unique ID?

    是否要为您的表提供唯一的ID?

    Use the id shortcode attribute:

    使用 id 简码属性:

    [csv src=http://example.com/myfile.csv id=my_data_table]

      [csv src = http://example.com/myfile.csv id = my_data_table]

    The above example would give the

    element an id attribute of my_data_table.

    上面的示例将为

    元素赋予 my_data_table id 属性。

    Group Classes

    小组课程

    Let’s say you have a table with three columns: Item, Description and Type.

    假设您有一个包含三列的表格:项目,说明和类型。

    You want all table rows of the same Type to have the same class, so you can highlight them in different colors using CSS or modify them all at once with JavaScript.

    您希望同一类型的所有表行都具有相同的类,因此您可以使用CSS以不同的颜色突出显示它们,或使用JavaScript一次修改它们。

    This can be done by assigning a column number to the group shortcode attribute:

    这可以通过将列号分配给 group shortcode属性来完成:

    [csv src=http://example.com/myfile.csv group=3]

      [csv src = http://example.com/myfile.csv group = 3]

    The result would be a special class assigned to each table row based on the value of the third column.

    结果将是根据第三列的值分配给每个表行的特殊类。

    Sorting Options

    排序选项

    By default, table data is sorted alphabetically.

    默认情况下,表数据按字母顺序排序。

    If you want to sort columns numerically or as dates, or disable sorting on certain columns, use the following shortcode attributes:

    如果要按数字或日期对列进行排序,或者要禁用某些列的排序,请使用以下shortcode属性:

    [csv src=http://example.com/myfile.csv number=2]

      [csv src = http://example.com/myfile.csv编号= 2]

    [csv src=http://example.com/myfile.csv date=3]

    [csv src = http://example.com/myfile.csv date = 3]

    [csv src=http://example.com/myfile.csv unsortable=4,5,6]

    [csv src = http://example.com/myfile.csv unsortable = 4、5、6]

    The values can be a single column number, or multiple column numbers in a comma-separated list (no spaces!).

    值可以是单个列号,也可以是逗号分隔列表中的多个列号(无空格!)。

    Relative File Paths

    相对文件路径

    If the src value is a relative path (beginning with a forward slash), the plugin will refer to the “Site address (URL)” defined in WP-Admin > Settings >

    如果 src 值是相对路径(以正斜杠开头),则插件将引用 WP-Admin>设置>中定义的“站点地址(URL)”。

    General:

    常规

    [csv src=/mydata/data.csv]

      [csv src = / mydata / data.csv]

    The above example would refer to http://example.com/mydata/data.csv.

    上面的示例将引用 http://example.com/mydata/data.csv

    Data Array Filter

    数据数组过滤器

    You may want to manipulate the CSV data after it is imported, but before the HTML table is rendered.

    在导入CSV数据之后但呈现HTML表之前,您可能需要操作CSV数据。

    To do so, use this filter:

    为此,请使用以下过滤器:

    csv_to_sorttable_data_array

      csv_to_sorttable_data_array

    Here are some code examples of how to use the data array filter:

    以下是一些有关如何使用数据数组过滤器的代码示例:

      1. Remove First Row (Function)
      2. 删除第一行(功能)

      3. Add a Header Row (Function)
      4. 添加标题行(函数)

      5. Add a Header Row (Plugin)
      6. 添加标题行(插件)

      Credits

      积分

      This plugin utilizes some excellent open source scripts, functions and images whose creators deserve to be recognized.

      此插件利用了一些优秀的开源脚本,功能和图像,其创建者值得认可。

        1. Stuart Langridge wrote sorttable.js, the JavaScript that inspired this plugin and makes

        2. Stuart Langridge编写了 sorttable.js ,该JavaScript启发了该插件并

          it possible to sort tables by clicking on the column headers.

        3. 可以通过单击列标题对表进行排序。

        4. V.Krishn wrote a handy PHP function that enables users of PHP < 5.3 to utilize the

        5. V.Krishn编写了一个方便的 PHP函数,该函数使PHP <5.3的用户能够使用

          >str_getcsv() function that powers this plugin.

        6. 为该插件供电的> str_getcsv()函数。

        7. Blake Knight created the beautiful file type

        8. Blake Knight创建了漂亮的文件类型

          icons used in this plugin and made them free for all.

        9. 图标在该插件中使用,并免费提供给所有人。

        安装步骤

          1. Install and activate the plugin via WP-Admin > Plugins.
          2. 通过 WP-Admin>插件安装并激活插件。

          3. Add shortcode to a post or page: [csv src=http://example.com/data.csv].
          4. 在帖子或页面上添加简码: [csv src = http://example.com/data.csv]

          5. Use optional shortcode attributes to modify table behavior (see description).
          6. 使用可选的简码属性来修改表的行为(请参见说明)。

        下载地址
        https://downloads.wordpress.org/plugin/csv-to-sorttable.4.2.zip
        -EOF-

        AI助手支持GPT4.0