close

Filter

loading table of contents...

Solution Overview for Business Users / Version 2506.0

Table Of Contents

9.13.1.3 PageGridPlacement Component

For this example app the resulting web page will look very basic. So for any banner, it renders only the teaserTitle and teaserText. How to render an image is described in the following section.

const divStyle = {
        border: '1px solid black',
        margin: '10px',
        padding: '10px'
        };

        function PageGridPlacement(props) {
        const name = props.name;
        const items = props.items || [];
        return (
        (items.length > 0 &&
        <div className={name} style={divStyle}>
        <h1>Placement: {name}</h1>
        {items.map((item) => (
        ((item.teaserTitle || item.teaserText) && <div style={divStyle}>
        <h2>{item.teaserTitle}</h2>
        <p>{item.teaserText}</p>
        </div>)
        ))}
        </div>)
        );
        }

Example 9.9. The PageGridPlacement Component


pwa example homepage

Figure 9.4. Screenshot of the example homepage


Note

Note

Writing everything in one component can quickly lead to large and messy files. To prevent this, the query can be imported from a separate file in the components folder.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

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