search
HomeCMS TutorialEmpire CMSWhy can't I set up the Imperial CMS homepage to call data from other websites?

Calling other website data on the Imperial CMS homepage requires four steps: Determine the data source (website URL) Create an external data source (data source name, address, encoding, cache time) Create a data model (model fields, Calling address, calling method) Calling data (use [getfield] tag, specify field ID, model name, data ID, ispage)

Why can't I set up the Imperial CMS homepage to call data from other websites?

##How to Empire CMS homepage calls other website data

Step 1: Determine the data source

Determine the URL of the website where the data that needs to be called is located.

Step 2: Create an external data source

In the "External Data Source" menu of the Imperial CMS backend, create a new external data source.

  • Data source name: Give the external data source a name that is easy to identify.
  • Data source address: Enter the URL of the website where the data needs to be called.
  • Data source encoding: Select the encoding method of the website, usually UTF-8 or GBK.
  • Cache time: Set the time for data caching to speed up subsequent calls.

Step 3: Create a data model

In the "Data Model" menu of the Imperial CMS background, create a new data model to store the called data .

  • Model fields: Set the fields in the data model to correspond to the data in the external data source.
  • Calling address: Enter the address of the external data source.
  • Calling method: Select the calling method, usually HTTP GET.

Step 4: Call data

Where data needs to be displayed, use the [getfield] tag of Empire CMS to call external data.

[getfield id=字段id model=模型名 dataid=数据id ispage=1]

  • Field id: The field ID that needs to display data.
  • Model name: The name of the data model for calling data.
  • Data id: The ID of the data that needs to be displayed.
  • ispage: Whether to call in paging, 1 means yes, 0 means no.

Example:

[getfield id=title model=external_data dataid=1 ispage=0]

This tag will call the value of the "title" field with ID 1 in the data model named "external_data".

The above is the detailed content of Why can't I set up the Imperial CMS homepage to call data from other websites?. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.