
前言介紹
- 這款 WordPress 外掛「CSV to SortTable」是 2011-11-07 上架。
- 目前有 100 個安裝啟用數。
- 上一次更新是 2013-07-11,距離現在已有 4315 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.2.1 以上版本才可以安裝。
- 有 11 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
sscovil |
外掛標籤
csv | data | sort | table | import |
內容簡介
CSV to SortTable 插件非常適合想要在 WordPress 網站上展示試算表資訊的使用者。此插件可用於顯示產品目錄、庫存清單、排行榜或任何存儲在 CSV 檔案中的內容。
使用方式
使用以下簡碼在任何頁面或文章中插入可排序的表格:
[csv src=http://example.com/myfile.csv]
結果將是一個漂亮、語意正確的 HTML 表格,其內容為您的檔案。
選用功能
此插件自動為您執行一些動作,全部可禁用:
新增了一些 CSS 以使表格顯示得更好看。
將圖片檔案 URL 轉換為可點擊的圖片連結。
將某些檔案 URL 轉換為可點擊的檔案類型圖示 (.doc、.pdf、.ppt、.xls、.zip)。
使用 disable 簡碼屬性就可以停用任何其中一些功能:
[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=all]
第一個範例僅停用插件 CSS;第二個範例會停用檔案類型圖示和影像連結;而第三個範例會停用所有選用功能。使用逗號分隔的清單 (不含空格) 停用任何組合。
表格 ID
想要為表格指定唯一的 ID 嗎?使用 id 簡碼屬性:
[csv src=http://example.com/myfile.csv id=my_data_table]
上面的範例會給
元素新增一個 id 屬性為 my_data_table。
分組類別
假設您有一個具有三個欄位的表格:物品、描述和類型。您希望所有相同類型的表格列具有相同的類別,這樣就可以使用 CSS 以不同的顏色加以凸顯,或使用 JavaScript 一次性修改它們。
可藉由將欄位編號指定為 group 簡碼屬性完成此操作:
[csv src=http://example.com/myfile.csv group=3]
結果會根據第三個欄位的值,指定每個表格列的特殊類別。
排序選項
預設情況下,表格資料以字母順序排序。如果您希望對欄位進行數字或日期排序,或在某些欄位上禁用排序,則可以使用以下簡碼屬性:
[csv src=http://example.com/myfile.csv number=2]
[csv src=http://example.com/myfile.csv date=3]
[csv src=http://example.com/myfile.csv unsortable=4,5,6]
值可以是單個欄位編號,也可以是逗號分隔的多個欄位編號清單 (不含空格!)。
相對檔案路徑
如果 src 值是相對路徑 (以斜線開頭),則插件將參照 WP-Admin > 設定 > 一般 中定義的「網站位址 (URL)」:
[csv src=/mydata/data.csv]
上面的範例會參照 http://example.com/mydata/data.csv。
資料陣列篩選器
您可能希望在匯入 CSV 資料後,但在呈現 HTML 表格之前,對這些資料進行操作。為此,請使用此篩選器:
csv_to_sorttable_data_array
以下是如何使用資料陣列篩選器的一些程式碼範例:
移除第一列(函數)
新增標題列(函數)
原文外掛簡介
CSV to SortTable is great for anyone who wants to display information from a spreadsheet on a WordPress website. This plugin can be used to display product catalogs, inventory lists, leaderboards or anything else that can be stored in a CSV file.
How To Use
Insert a sortable table into any page or post using this shortcode:
[csv src=http://example.com/myfile.csv]
The result will be a beautiful, semantically-correct HTML table populated with the contents of your file.
Optional Features
This plugin automatically does a few things for you, all of which can be disabled:
Adds some CSS to make the table look nice.
Converts image file URLs into clickable image links.
Converts certain file URLs into clickable file-type icons (.doc, .pdf, .ppt, .xls, .zip).
To disable any of these features, use the disable shortcode attribute:
[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=all]
The first example would disable only the plugin 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
Want to give your table a unique ID? Use the id shortcode attribute:
[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.
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.
This can be done by assigning a column number to the group shortcode attribute:
[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:
[csv src=http://example.com/myfile.csv number=2]
[csv src=http://example.com/myfile.csv date=3]
[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 > General:
[csv src=/mydata/data.csv]
The above example would refer to 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. To do so, use this filter:
csv_to_sorttable_data_array
Here are some code examples of how to use the data array filter:
Remove First Row (Function)
Add a Header Row (Function)
Add a Header Row (Plugin)
Credits
This plugin utilizes some excellent open source scripts, functions and images whose creators deserve to be recognized.
Stuart Langridge wrote sorttable.js, the JavaScript that inspired this plugin and makes it possible to sort tables by clicking on the column headers.
V.Krishn wrote a handy PHP function that enables users of PHP
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「CSV to SortTable」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
3.1 | 4.0 | 4.1 | 4.2 | trunk |
延伸相關外掛(你可能也想知道)
One Click Demo Import 》這個外掛的最佳功能在於主題作者可以在他們的主題中定義導入文件,所以所有使用該主題的用戶只需點擊「導入演示數據」按鈕即可。, , 你是主題作者嗎?, 為你...。
Widget Importer & Exporter 》Widget Importer & Exporter 是一個有用的外掛,可將小工具從一個WordPress站點移動到另一個站點,備份小工具,並供主題開發人員為用戶提供範例小工具。...。
Customizer Export/Import 》自訂面板匯出/匯入, 自訂面板匯出/匯入外掛讓您能夠直接從自訂面板界面匯出或匯入您的 WordPress 自訂設定!如果您的佈景主題使用 WordPress 自訂面板進行設...。
Search & Replace 》, 注意:此外掛未進行維護。, , 程式碼會繼續留在 SVN 和 Github 上,如果您有興趣。, 使用「Search & Replace」工具,您可以搜尋任何內容並以其他內容取...。
Import and export users and customers 》在您的免費測試網站中試試看:點擊此處 => https://demo.tastewp.com/import-users-from-csv-with-meta, 一個乾淨易用的用戶和客戶導入/導出外掛,適用於 ...。
Add From Server 》這個外掛提供有限的支援。請不要期望有太多新功能或修正 bug。功能可能隨時被移除。, Add From Server 外掛旨在幫助緩解不好的網站主機所造成的困擾,讓您可...。
Import / Export Customizer Settings 》Astra主題自定義設置提供了多種頭部/腳部佈局、側邊欄和博客設計、顏色、背景、字體等設置。您需要微調這些設置,使您的網站看起來完美無瑕。這些設置可以通...。
WP Import Export Lite 》o.com/goto/wpimportexport" target="_blank">WordPress Import Export 插件 是一款易用、快速且進階的匯入和匯出網站數據的工具。, WordPress Import Export...。
aThemes Starter Sites 》我們擁有豐富且不斷擴展的庫存,裡面裝載著任何種類企業所需的現成模板。, ATHEMES STARTER SITES, 企業業主、自由工作者、網上商店所有者和創意人員:準備好...。
FameTheme Demo Importer 》這款 WordPress 外掛是官方的 FameThemes 主題,一鍵匯入主題的範例內容、小工具與設定。, 如有需要,可以到 https://www.famethemes.com/ 取得免費支援。, ,...。
Rara One Click Demo Import 》您喜歡 Rara Theme 製作的主題展示嗎?還是需要設定主題的指南?, 那麼,您只需要這個外掛!, Rara One Click Demo Import 外掛可以幫助您一鍵匯入演示內容,...。
Media Sync 》您可以掃描所有在uploads目錄中的檔案,並查看哪些檔案實際上在媒體庫中,哪些檔案只是停留在那裡。然後,您可以選擇要將哪些檔案導入數據庫,從而使它們在媒...。
Import Products from any XML, CSV or Excel to WooCommerce 》ouble with special characters., In summary, the WooCommerce add-on for WP All Import is a powerful tool for importing products into your WooCommerc...。
Demo Importer Plus 》Demo Importer Plus 是最佳和強大的演示內容導入外掛之一。它允許您輕鬆地通過單擊一個按鈕來導入演示內容、小工具、定制器設置以及主題設置。, 除此之外,您...。
WP CSV Exporter 》這個外掛程式可以按照每篇文章類型將文章匯出為 CSV 格式。, 此外,它也支援文章的自訂欄位和自訂分類法。, 您還可以設定要下載的文章數量或日期範圍。, 如何...。
Mastodon