close

Filter

loading table of contents...

Headless Server Developer Manual / Version 2204

Table Of Contents

14.2.5 Rendering an Article

The content for an article will not be loaded via the page query for the homepage, since it only needed the banner information. So as a detail view, the article component fetches the required data with its own query using its content ID. You find the query in the completed component below. The articleId can have two different sources. Either the component was called by the router and it is found in the props.match object, or it was directly passed into the component, for example by the fragment preview and is a direct property:

const idFromLink = props.match.params.id;
const articleId = idFromLink ? idFromLink : props.id;

Example 14.11. Identify id of article


The title can immediately be used and rendered as a <h1> tag for example. But the URI of the picture and the detail text need further processing to work. This is done in the next two sections.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.