For content that rarely changes, the second route is the better one. For anything that has to be calculated at the moment of the request, only the first remains.
External includes
The two tags
Two tags embed the output of a third-party program at the position where they are placed. The difference lies in what the shop sends along.
With
WS-ExternInclude(), all existing GET and POST parameters are combined and passed in the parameters getbuf and postbuf. Form data from a form in the shop is additionally sent to the third-party program via POST.
The output of the third-party program may itself contain WEBSALE tags. This lets you display shop data within third-party content.
Specifying the address
The argument holds the address of the third-party program. Both tags support tag-in-tag, so the value of another tag can be part of the address. The tilde characters of the inner tag are replaced by dollar signs.getbuf parameter:
The shop establishes the connection to the third-party system on the server side, via a proxy. The visitor’s browser sees none of this and does not call the third-party address itself.
Checking whether the third-party system responds
If the third-party system fails, nothing appears in its place in the shop, and page rendering is delayed until the timeout. The LiveCheck checks in advance whether the system is reachable and lets you respond, for example with substitute content.Setup
The checks are defined in the<ExternSystemLiveChecks> section of shop.config, with one <+Entry> per check. Up to ten checks are possible.
Reference: ExternSystemLiveChecks section
The check file on the third-party server
For a check of type 1, the responseOK counts as success. Any other response and any missing response counts as failure.
Querying in the template
Points to note
To keep the impact of an outage small, wrap the area containing the external include in an AJAX section. The content is then only fetched when the visitor requests it, not on every page view.
Passing address data to a third-party system
If the third-party system needs the billing or delivery address, special tags pass it in the address of the call. A parameter determines how the data is protected.Defining the encoding
The tags
The data format
The data is generated in XML format, with the field number forming the element name:Only what is actually configured in
shop.config for the respective address is passed. A field that the shop does not collect does not appear in the transfer.
There are two fields for customer-specific data:
Connecting an editorial system
This chapter is being revised. If you have any questions, please contact your WEBSALE contact person.
Any editorial system that can export in JSON format can be connected.
How it works
The editorial system stores two kinds of files in the shop’s FTP area: one JSON file per content page, plus a mapping file that assigns each address its file. The addresses of the content pages contain a common directory, for example/cms/. This directory is the trigger: A server rule recognizes addresses that start with it and redirects them in the background to a shop template. The originally requested address is passed as a one-time parameter, and this is exactly how the template knows which JSON file to load.
Step 1: Activation and FTP access
Have the JSON interface activated. You will receive a separate FTP account for the files from the editorial system. The address rule must also be set up by WEBSALE system administration. Three settings are part of this setup. WEBSALE uses default values for them; let us know of any different requirements during setup:If you already use
OTP1 for something else, specify a different parameter during setup. Otherwise the two uses will overwrite each other.Step 2: Exporting content
One JSON file is created per content page and uploaded to the interface’s FTP directory.Step 3: Exporting the mapping file
The mapping file links address and file.Step 4: Creating the template
A single template is sufficient for all content pages, because the one-time parameter and the mapping file take over the control. First, the mapping file is loaded and the requested address is searched for in it:DC-FPjsonData.
This file is then loaded and read. The following example sets the values for the head section of the page:
The
{DC-FPjsonData} wrapper checks whether a file was found at all. Without it, the template tries to load a file without a name.Related topics
- Guide: JSON interface
- Guide: How WEBSALE AJAX integrations work
- Guide: Exchanging data with external systems
