Shared Code/Content
James Dodd avatar
Written by James Dodd
Updated over a week ago

Landing pages can re-use segments of code, and these segments of code can use other segments of code, and so on. We call these yields.

In this example the system will look for pages called 'header', 'content' and 'footer' and look to replace each yield element with the content from that page.

Example 'site-layout':

<!DOCTYPE html>
<html>
<head></head>
<body>
<yield name="header"></yield>
<yield name="content"></yield>
<yield name="footer"></yield>
</body>
</html>

If the above page is "yielded" by another page, that page can provide the content for each yield, if required. Any content not provided will cause the system to try and find a page to replace the element.

Example page that yields to another and provides content:

<yield name="site-layout"></yield>
<content for="content">
I will be placed in the 'content' yield of the site layout.
</content>
Did this answer your question?