-
Notifications
You must be signed in to change notification settings - Fork 648
Deprecation: layout tag
Bhavin Patel edited this page Dec 26, 2018
·
3 revisions
The layout
tags have been deprecated in favor of using <${dynamic}/>
as shown below:
Old:
<layout-use('../../layouts/site-layout.marko')>
<layout-put into="body">
Hello World
</layout-put>
</layout-use>
New:
import SiteLayout from '../../layouts/site-layout.marko';
<${SiteLayout}>
<@body>
Hello World
</@body>
</>
New (Recommended):
<site-layout>
<@body>
Hello World
</@body>
</site-layout>
Related Docs: http://markojs.com/docs/custom-tags/#writing-custom-tags
Old:
<!doctype>
<html>
<body>
<layout-placeholder name="body">
Default body content
</layout-placeholder>
</body>
</html>
New:
<!doctype>
<html>
<body>
<if(input.body)>
<${input.body}/>
</if>
<else>
Default body content
</else>
</body>
</html>
Old:
<!doctype>
<html>
<body>
<layout-placeholder name="body"/>
</body>
</html>
New:
<!doctype>
<html>
<body>
<${input.body}/>
</body>
</html>
Related Docs: http://markojs.com/docs/core-tags/#layouts-with-nested-attributes
To automatically fix deprecated marko syntax, try the marko migrate
command from the CLI.