Skip to content

Commit fc7200f

Browse files
author
bgantick
committed
Add examples to readme
1 parent adc4374 commit fc7200f

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

Diff for: README.md

+38-1
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,41 @@ modules: {
4141

4242
## Classes
4343

44-
## Extends
44+
## Extending
45+
46+
Example of project-level extension...
47+
```
48+
// in app.js
49+
...
50+
modules: {
51+
...
52+
'my-people': { extend: 'pk-people' },
53+
'my-people-pages': { extend: 'pk-people-pages' },
54+
'my-people-widgets': { extend: 'pk-people-widgets' }
55+
}
56+
...
57+
```
58+
59+
Adding a field to people...
60+
`lib/modules/my-people/index.js`
61+
```
62+
module.exports = {
63+
addFields: [
64+
{
65+
name: 'newField',
66+
label: 'New Field',
67+
type: 'string'
68+
}
69+
]
70+
};
71+
```
72+
73+
Extending a template...
74+
`lib/modules/my-people-pages/views/index.html`
75+
```
76+
{% extends 'indexBase.html' %}
77+
78+
{% block header %}
79+
<h1>HELLO</h1>
80+
{% endblock %}
81+
```

0 commit comments

Comments
 (0)