Skip to content

Commit 51d310c

Browse files
committed
Update README.md
1 parent 8b633a5 commit 51d310c

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ list:
214214
- Three
215215
---
216216
```
217-
and **_context.js** files ([example](https://github.com/modularcode/modular-admin-html/blob/master/src/_context.js)).
217+
and **_context.js** files.
218218
```
219219
module.exports = {
220220
foo: 'bar',
@@ -227,17 +227,26 @@ module.exports = {
227227
}
228228
```
229229

230-
The final result of page context is compination of both ways. Moreover, different depth level _context.js files are extending each other and then are extended with YAML headers data. In our case we have ```src/_context.js``` file, where main website properties are defined and YAML headers in ```*-page.hbs``` files.
230+
The final result of page context is compination of both ways. Moreover, different depth level _context.js files are extending each other and then are extended with YAML headers data. For simplicity we use only **YAML** headers.
231231

232232
#### Layouts (*-layout.hbs)
233233

234234
If different pages have lot of common components like sidebar, header, footer, It's a good idea to define a layout for those common pages and define in page files only the content which is unique.
235235

236236
Layout is a page content wrapper. If the page has layout in output we'll get page's content inserted into layout. Layouts should have ```{{{body}}}``` handlebars tag, which is entry point for page content. ([example](https://github.com/modularcode/modular-admin-html/blob/master/src/app/app-layout.hbs))
237237

238-
To define a page layout you need to specify page file context's ```layout``` variable. It can be done both by YAML header or _context.js file. ([example](https://github.com/modularcode/modular-admin-html/blob/master/src/app/forms/forms-page.hbs))
238+
To define a page layout you need to specify page file context's ```layout``` variable. It can be done both by YAML header or _context.js file. ([example](https://github.com/modularcode/modular-admin-html/blob/master/src/app/forms/forms-page.hbs)).
239239

240-
If you need more advanced layouting you can use [handlebar-layouts](https://www.npmjs.com/package/handlebars-layouts) helper approach, which is also available out of the box.
240+
Layouts can also have contexts and parent layouts.
241+
242+
```
243+
{_main-layout.hbs} # main layout with doctype, head, scripts declaration
244+
{app/app-layout.hbs} # dashboard layout with sidebar, header and footer
245+
{app/forms/forms-page.hbs} # any dashboard page
246+
```
247+
248+
249+
If you need more advanced layouting with multiple content blocks at the same time you can use [handlebar-layouts](https://www.npmjs.com/package/handlebars-layouts) helper approach, which is also available out of the box.
241250

242251
#### Vendor files
243252

0 commit comments

Comments
 (0)