-
Notifications
You must be signed in to change notification settings - Fork 648
Deprecation: layout tag
Taylor Hunt edited this page Aug 6, 2019
·
3 revisions
The <layout-*>
tags are deprecated, replaced with first-class language support for custom tags and attribute tags.
Old:
<layout-use('../../layouts/site-layout.marko')>
<layout-put into="body">
Hello World
</layout-put>
</layout-use>
New (Recommended):
<site-layout>
<@body>
Hello World
</@body>
</site-layout>
However, you can also manually import
a component, instead of using tag autodiscovery:
import SiteLayout from '../../layouts/site-layout.marko';
<${SiteLayout}>
<@body>
Hello World
</@body>
</>
Old:
<!doctype html>
<html>
<body>
<layout-placeholder name="body">
Default body content
</layout-placeholder>
</body>
</html>
New:
<!doctype html>
<html>
<body>
<if(input.body)>
<${input.body}/>
</if>
<else>
Default body content
</else>
</body>
</html>
Old:
<!doctype html>
<html>
<body>
<layout-placeholder name="body"/>
</body>
</html>
New:
<!doctype html>
<html>
<body>
<${input.body}/>
</body>
</html>
To automatically fix deprecated marko syntax, try the marko migrate
command from the CLI.