[WordPress] 外掛分享: HTML filter and csv-file search

前言介紹

  • 這款 WordPress 外掛「HTML filter and csv-file search」是 2016-08-08 上架。 目前已經下架不再更新,不建議安裝使用。
  • 目前有 200 個安裝啟用數。
  • 上一次更新是 2023-08-22,距離現在已有 918 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 5.0 以上版本才可以安裝。
  • 有 5 人給過評分。
  • 論壇上目前有 1 個提問,問題解答率 0%

外掛協作開發者

jonashjalmarsson |

外掛標籤

csv | excel | filter | jquery | search |

內容簡介

這個外掛包含兩種不同的短碼;[csvsearch] 可以啟用在上傳到媒體庫的 CSV 檔案中進行搜尋。輸入 URL 到短碼中,即可添加一個包含搜尋框的按鈕。透過 jQuery-ajax 的呼叫方式,它能在 CSV 檔案中找到匹配的資料行並以指定的格式顯示出來。 [filtersearch] 可以在一個頁面上啟用篩選搜尋框,使用 jQuery 即時篩選內容。透過短碼屬性,您可以設置要篩選的元素和其他設置。

[csvsearch]

使用短碼在任何文章或小工具中添加 CSV 檔案搜尋功能:
[csvsearch src=”https://path_to/content/file.csv”]

透過這個短碼,一個搜尋按鈕將被生成,並且它能即時進行 AJAX 搜尋,找到符合搜索的輸入的 CSV 檔案中的資料行並回傳。

請參考來自 jonashjalmarsson.se 的部落格文章,可查看實際範例。

設置:

有一些設置可以控制搜尋和輸出。

src 輸入要搜尋的檔案路徑,檔案是透過媒體庫進行上傳的。找到其 URL 並在這個屬性中輸入。

format 設定輸出的每行內容的格式。
使用 {b} 來換成等等資訊。所有的 { 和 } 都將被替換成 < 和 >。
使用 {0}, {1} 等等,將想要取得的欄位放到輸出行中。
預設值為:{b}{0}{/b}, {1}, {2}{br/}
第一欄 (粗體), 第二欄, 第三欄以換行符號結束。

searchtext 顯示在搜尋按鈕中的文字。預設為瑞典語:‘Sök’。

charset 預設的 charset 為 ‘iso-8859-1’,可以透過此屬性設置任何可用的 charset。

instantsearch 是否啟用即時搜尋。即輸入文字時顯示下拉式列表。預設值為 ‘false’。

instantformat 即時搜尋的格式。預設為 ‘{0}’。

dataidformat 包含 ID 的欄位。當點擊下拉式列表時使用。預設為 ‘{0}’。

csv_separator 設定要使用的欄位分隔符號。通常是使用「,」或「;」,取決於 CSV 的類型。預設值為 ‘;’。

nothing_found_message 當沒有搜尋到符合的結果時,可自訂訊息。預設值為 ‘Nothing found when searching for: ‘

exact_match 設置為 true,只匹配完全相符的搜尋結果,區分大小寫。預設為 ‘false’。

placeholder_text 設定搜尋框的提示文字。當進行搜尋後會被替換掉。預設為無。

only_search_in_column 僅在一個特定的欄位中進行搜尋。如果您只想在第一個欄位中進行搜尋,則應輸入 0。刪除此引數或添加-1以在所有欄位中進行搜索。 預設為-1

show_header_row 設置為 true 時,會將第一行顯示為標題行。預設為 ‘false’。

skip_file_check 跳過檔案檢查。當檔案檢查無法正常工作時,例如在 WP 安裝在子目錄中時,可使用此屬性。

短碼的螢幕截圖 1:
[csvsearch format=”{0} | {1} | {3}{br/}” src=”/files/2016/07/sizedata.csv”/]
這意味著要從檔案中顯示第一、第二和第四欄,並在兩欄之間使用分隔符和換行符號。

[filtersearch]

使用短碼在任何文章或小工具中添加篩選/搜尋功能:
[filtersearch]

原文外掛簡介

Two different shortcodes; [csvsearch] enables search in csv-file uploaded to the Media-library. Enter the URL in the shortcode to add a searchbox that will find matches in that file with a jquery-ajax-call and presents each row with the format specified. [filtersearch] enabled a filter search box to a page that filter contents instant with jquery. You can set the element to filter within and other settings through the shortcode attributes.
[csvsearch]
Add csv file search functionallity to any post or widget with the shortcode
[csvsearch src=”https://path_to/content/file.csv”]
With this shortcode a search button will be generated and will by instant-ajax-search search through the csv-file in the src attribute and return the rows found matching the search input.
Check blog post at jonashjalmarsson.se for live samples.
Settings:
There are some settings to control the search and output.

src Enter the path to the file to search, the file is uploaded through the Media archive as with any other file. Find the URL and enter it in this attribute.

format How each line in the output will be formatted.
Use {b} to render etc. All { and } will be replaced with < and >.
Use {0}, {1} etc. to place the columns where you want in the output line.
Default is: {b}{0}{/b}, {1}, {2}{br/}
column1 (in bold), column2, column3 end with line-break.

searchtext Text that will be shown in search button. Default is in swedish: ‘Sök’.

charset Default charset is ‘iso-8859-1’. Can be set to any charset available through this attribute.

instantsearch Should instant search be enabled. I.e. dropdown results when entering text. Default is ‘false’.

instantformat Format for instant search. Default is ‘{0}’.

dataidformat Which column contains ID. Is used when click on dropdown. Default is ‘{0}’.

csv_separator Set column delimiter to use. , or ; is normally used depending on csv type. Default is ‘;’

nothing_found_message Set your own message when there are no hits in search. Default is ‘Nothing found when searching for: ‘

exact_match Set to true to only match exact matches, case sensitive. Default is ‘false’

placeholder_text Set a text to be seen as placeholder for the search. Will be replaced when a search is made. Default is none.

only_search_in_column Only search in one specific column. Enter 0 if you only want to search in first column. Remove this argument or add -1 to search in all columns. Default is -1

show_header_row Show first row as a header row by setting to true. Default is ‘false’

headerformat Combine with show_header_row to set format for header row. See format above to see more info.

ignore_default_header_style Set to true to ignore default style for header row. Default is ‘false’.

skip_file_check Skip the file check. Use when file check not working properly, for exampel when WP installed in sub directory.

set_focus_on_load Set to true to focus input element on page load, set false if not to focus. Default is ‘false’.

Screenshot 1 shortcode:
[csvsearch format=”{0} | {1} | {3}{br/}” src=”/files/2016/07/sizedata.csv”/]
Which means showing first, second and fourth column from the file with a separator between and line break at the end.
[filtersearch]
Add filter/search functionallity to any post or widget with the shortcode
[filtersearch]
With this shortcode a filter input will be generated and will instant filter the content in the page or post. You will be able to select if all page will be filtered or just some of the elements.
Settings:
There are some settings to control the filter.

search_element Select within which html-element the content should be filtered. Should be entered as ‘element.classname’ (i.e. table.content or .content) in any form combining element, id and/or classname.

show_header_in_table Set to true if the first row in table is a title and always should be visible. Only affects when filtering tables.

text Replace the standard text placed in front of search box.

clear_icon_class Class to use to show ‘clear’-icon. Default is ‘delete-icon’.

clear_text Text to show in the clear button, useful instead of icon. Default is empty.

set_focus_on_load Set to true to focus input element on page load, set false if not to focus. Default is ‘true’.

Screenshot 2 shortcode:
[filtersearch text=”Sök hämtningsdag för din ort” search_element=”table” show_header_in_table=”false”]

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「HTML filter and csv-file search」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


1.9 | 2.0 | 2.1 | 2.2 | 2.3 | 2.4 | 2.5 | 2.6 | 2.7 | trunk |

延伸相關外掛(你可能也想知道)

  • HUSKY – Products Filter Professional for WooCommerce 》HUSKY – Products Filter Professional for WooCommerce(前名為WOOF)是一款針對WooCommerce的產品搜尋外掛程式,它允許你的網站客戶通過類別、屬性、...。
  • Search & Filter 》Search & Filter 是一款簡單的 WordPress 搜尋和篩選外掛程式,是 WordPress 搜尋框的進階版。, 您可以透過類別、標籤、自訂分類、文章類型、發佈日期或...。
  • Allow HTML in Category Descriptions 》當您在類別描述文本區添加文字並保存類別時,WordPress會運行內容過濾器,剝除除最基本格式標籤以外的所有內容。, 這個外掛程式可以禁用具有必要權限的角色的...。
  • Category Ajax Filter 》支援 Elementor Builder, 不用重新載入網頁,即可按類別篩選文章/自訂文章類型中的文章。在前端選擇特定的分類和分類名詞。使用預置的多種版面和 Ajax 請求來...。
  • Filter & Grids 》使用 AJAX 篩選自定義分類 / 分類標籤來篩選文章或自定義文章類型,無需重新載入頁面,並支持不同的分頁類型。這款外掛允許解決顯示網站頁面上的文章的各種任...。
  • Random Post Plugin – Redirect URL to Post 》重定向您的訪客到:, , 隨機文章, 您最新的文章, 您最舊的文章, 前一篇或下一篇文章, 或一組條件的組合,例如最新的10篇文章中的隨機文章,至少3個月前的最新...。
  • Jetpack Search 》Jetpack Search 是一款功能強大且可自定義的外掛,可幫助訪問者在需要時立即找到正確的內容。, Jetpack Search 是一款易於使用的 WordPress 搜尋外掛,可增強...。
  • WP Ultimate Post Grid 》使用 WP Ultimate Post Grid 可以建立帖子、頁面或任何自訂文章類型的回應式網格。可以選擇性為與這些文章相關聯的任何分類,添加等離子過濾器。, , , 查看這...。
  • WordPress Meta Data and Taxonomies Filter (MDTF) 》WordPress Meta Data Filter & Taxonomies Filter(MDTF)是一個 WordPress 的篩選外掛程式,可以讓您的網站內容通過資料的元欄位和稅務分類項進行篩選和...。
  • Filter Orders by Product for WooCommerce 》曾經想要按特定產品篩選訂單頁面結果嗎?現在有了這個外掛,就能做到!, 安裝此外掛後,在 WooCommerce 訂單畫面中會出現一個新的篩選下拉式清單。此下拉式清...。
  • Simply Show Hooks 》迄今為止,主題和外掛開發人員尋找用於 add_action() 和 add_filter() 函式的接口位置方法是搜尋WordPress代碼庫或在Codex中找到接口的參考。, Simply Show H...。
  • Advanced Post Manager 》這是一個針對開發者所設計的工具,可以透過添加 metadata、taxonomy 等資訊來協助加強自訂文章類型的列表功能。此外,也提供直觀的介面讓您可以添加及儲存複...。
  • Beautiful taxonomy filters 》Beautiful Taxonomy Filters 是一款易於使用且外觀優美的 WordPress 外掛程式,可讓您為文章類型提供過濾功能,同時能根據自訂分類、標籤等加入過濾。此外,...。
  • WOOF by Category 》WOOF by Category 是一個 WooCommerce 商品篩選器(WOOF)擴充外掛,允許使用者在不同的商品分類中設置不同的 WOOF 篩選器。, 外掛具有後台選項頁面,可設置...。
  • Nice page transition 》這款 WordPress 外掛可以讓你選擇 6 種美麗的頁面轉場效果。 示範影片。你也可以在我的商店中查看其他 WordPress 專業外掛。。

文章
Filter
Apply Filters
Mastodon