
內容簡介
在你的 WordPress 網站上展示 JSON-Feed/API 的即時資料!
從網址上抓取 JSON 資料並在 WordPress 頁面上轉換為 HTML。
JSON Content Importer-API-和 Web 服務連接器-功能強大且簡單的 JSON 匯入外掛:
使用樣板引擎顯示從 JSON-Feed 中的資料。
定義 JSON-Feed 的 URL、樣板以及其他選項,例如顯示的項目數量、快取時間等。
具有新選項的快取程序:如果 HTTP-API 請求失敗,可以使用已快取的 JSON。在外掛的設置中設置單選按鈕:如何處理 API 問題(非有效的 API HTTP 回應或非 JSON API 回應或兩者兼備)。為了向後兼容,默認情況下關閉此功能。建議:啟用外掛快取(例如幾分鐘),並在外掛選項中選擇「如果 API HTTP 回應碼不是 200 或發送無效的 JSON:嘗試使用已快取的 JSON」的單選按鈕。
模板引擎會在模板中插入 JSON 資料。
您可以將其作為 WordPress 短代碼放在頁面中 - 其中一些額外功能(如 URL 編碼)可以被調用。
或者使用 Gutenberg 模式:然後您將不必費心地組合、測試和更改短碼。使用 Gutenberg 塊,您可以實時測試它並創建短碼(如果您想使用短碼)。
如何開始和幫助
使用此插件的第 1 和 2 步驟,以及:示例和專業版。
使用插件的範例
短代碼的基本結構:
‘[jsoncontentimporter
url=”http://…json”
numberofdisplayeditems=”數字:顯示幾個第一層項目?顯示全部:保留空白或設置為-1″
urlgettimeout=”數字:載入網址的秒數?”
basenode=”資料集的起點,在 JSON-Feed 中的基礎節點”
oneofthesewordsmustbein=”預設為空,如果不空,請輸入以‘,’分隔的關鍵字。必須至少有這些關鍵字中的一個出現在創建的文字中(這裡:text=code without html-tags)”
oneofthesewordsmustbeindepth=”預設值:1、數字:在 JSON 樹中,須在 oneofthesewordsmustbein 中的位置為何?”
]
這是樣板:
任何 HTML 代碼加上「basenode」數據字段(用「{}」包裹)
{subloop:「basenode_subloop」:「要顯示的子循環資料集數量」}
任何 HTML 代碼加上「basenode_subloop」數據字段(用「{}」包裹)。如果 JSON 資料是 HTML,請添加「html」標誌,例如「{fieldname:html}」
{/subloop:「basenode_subloop」}
[/jsoncontentimporter]’
範本如「{subloop-array:AAAA:10}{text}{subloop:AAAA.image:10}{id}{/subloop:AAAA.image}{/subloop-array:AAAA}」是可能的:
一個是「subloop-array」和「subloop」的遞歸使用。
第二個是「{subloop:AAAA.image:10}」,其中「AAAA.image」是對像的路徑。這對某些 JSON 資料很好。
一些特殊的資料欄位附加功能
“{street:purejsondata}”:數據欄位的默認顯示方式不是 HTML,但 HTML 標記已轉換:使用此功能可真正使用 JSON-Feed 中的原始數據。
“{street:html}”
外掛標籤
開發者團隊
② 後台搜尋「Get Use APIs – JSON Content Importer」→ 直接安裝(推薦)
📦 歷史版本下載
原文外掛簡介
The simplest method to link WordPress with external APIs
JCI simplifies the task of retrieving data from a third-party REST API. The returned JSON-, XML, CSV, TXT-data can be neatly arranged and showcased on your WordPress site via a shortcode, a JCI Block or PHP. The plugin can generate a template for the data display.
20 seconds: Load API and display data
7 minutes: Basic intro to JCI free
Examples, Preview
Check out the live demonstration to explore how we’re interfacing with various APIs
LIVE PREVIEW – WordPress and a external API
Video: How to use the Wikipedia API
Main Plugin Features
Low code usage: Save time and avoid coding using an API
Insert an API-URL into Step 1: Data is loaded, and and displayed. Save it as API-Access-Set.
Use the API-Access-Set in Step 2 to create a Shortcode
Optional for maximum flexibility: Use the API-Access-Set n PHP code
Insert an API-URL into the JCI Block: Data is loaded, and a template can be generated to display the data.
Easy to start: Check Installation – Is your WordPress ready for JCI? Most probably!
Basic Settings: Check SSL, Cacher, Gutenberg and Authentication
ContactForm7 Integration: Populate CF7 forms with JSON data and forward CF7-submitted data to an API.
Use the JCI cacher to avoid many API requests
JCI-Block : Use the simple JCI Block interface to get data! Query the API and check the response. Then utilize the simple template generator inside the JCI Block to use the data!
Contact Form 7 Integration: Fill form and submit to API
Documentation
There’s a wealth of resources and support at your fingertips. Explore the articles listed below to begin your journey:
JCI Manual
Step 1: Access the Data
Step 2: Using the Data
Shortcode – Basic structure
Contact Form 7 Integration
Free JCI Plugin: Overview Videos
Free JCI Plugin: Getting Started
You need more?
JSON Content Importer PRO
Both the free and PRO JCI Plugins serve the same purpose: retrieving data, transforming it, and publishing the results.
However, while the free Plugin can only handle basic challenges, the PRO JCI Plugin offers nearly full control over WordPress, the database, and applications.
Compare: Free vs. JCI PRO Plugin
PRO features:
* application building by creating a searchform and connect it to a JSON-API in the background: pass GET-Variables to use a dynamic JSON-Feed-URL (“talk to API / webservice”)
* much better and more flexible templateengine: twig
* create and use Custom Post Types
* store Templates independent of pages
* more Shortcode-Parameters
* executing Shortcodes inside a template
* more features…
