ContentControl- intervene in the HTTP header for this purpose.
Guide: SEO URLs, section Redirect concept for content from third-party systems
The prerequisite
These tags do not work on just any template. The template must be entered in the shop configurationshop.config in the <ContentControlLoadTemplates> section and called via WS-LoadTpl() or WS-SSLLoadTpl().
Use
ST-ContentControl to check whether the function applies at all at the point where you are. Wrap the entire block in it; then it remains ineffective on a wrong template instead of faulty.The complete example
A piece of content from the third-party system has disappeared, and the page should respond with its own 404 document.ContentControl-SetHeader_Status()
Sets the HTTP status code of the response.The tag is a single tag only and supports tag-in-tag. The status code can therefore come from another tag.
ContentControl-SetHeader_Location()
Sets the target address of the redirect. Together with a status code from the 300 range, this results in a complete redirect.A redirect does not need any content. Therefore, suppress the response body with
ContentControl-SuppressResponseBody; otherwise, the shop also sends the parsed template.Getting the target address from another tag
If the target address itself needs to be calculated first,DC-WSTagParameter-prepare provides the result of a tag as a parameter for another tag.
ContentControl-SetContentType()
Sets the content type of the response. Without this tag, the shop sendstext/html with the configured character set.
This tag is not described in the previous documentation, but it exists in the shop. It is useful when a template should not deliver HTML but, for example, JSON or XML.
ContentControl-SuppressResponseBody
Suppresses the response body. The shop then only delivers the headers.The tag can also be used as an area tag and then applies if ContentControl is active on this page at all. However, the content is only suppressed by the single tag. The area tag alone has no effect.
Replacing the response body
If your own content should be delivered instead of the parsed template, wrap it in a pair of markers.This is not a tag in the usual sense and is therefore not written in curly braces. The shop searches the fully parsed page for this pair of markers and cuts out everything in between. Exactly this excerpt becomes the response; everything before and after it is dropped.
The order in the response
The shop sets the headers in a fixed order: first the content type, then the cookies, then the status, then the location, then the file name if applicable, and finally the content.The order in the template does not matter. You can set the status before or after the location; the result is the same. The only important thing is that the tags are on the template before it is delivered.
Tags of other prefixes
The tags at a glance
All tags are only permitted on templates that are stored in the
<ContentControlLoadTemplates> section of the shop configuration.
Related topics
- Guide: SEO URLs and link optimisation
- Guide: Embedding external content
- Guide: JSON interface
- Reference:
<ContentControlLoadTemplates>section
