You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `url` attribute is mandatory. It shows under which path output html file will be saved. If you want to save in some specific folder, you can do it by providing the following value for `url` attribute:
34
+
The `url` attribute is mandatory. It shows under which path output html file will be saved. If you want to save it in some specific folder, you can do it by providing the following value for `url` attribute:
The `template` attribute is mandatory. It shows which template should be used to render current page. For now only flat structure is supported, so you can reference templates only from root of `Layout` folder.
43
43
44
-
You can use other synonimous for `template` attribute which are `TemplateId`, `Layout`, `LayoutId`. All those synonymous are caseinsensitive.
44
+
You can use other synonims for `template` attribute which are `TemplateId`, `Layout`, `LayoutId`. All those synonyms are case-insensitive.
45
45
46
46
> More details about templates / layouts can be found in the dedicated [layout](/folders-structure/layout.html) section.
47
47
@@ -54,33 +54,16 @@ The `title` attribute is not mandatory, but we recommend to use it for setting h
54
54
55
55
If predefined attributes are not enough and you want to add some extra attributes to your page, you can acheive that by using custom attributes section. The name of custom attribute should start with `custom` followed by `.`. After that you should add at least one character that will represent the name of your attribute.
56
56
57
+
> More advanced details about how to work with custom attributes can be found in [page custom attributes](/folders-structure/pages/attributes.html) section.
57
58
58
-
#### Page object
59
+
###Data model
59
60
60
-
All attributes can be accessible through global `Page` object. That object is accessible from each and every template and it always has a context of current page.
61
+
In case you want to use the same template, but use different data for it, you can use page data model. The scenario here is to have different data (in terms of values) with the same structure on different pages. The name of page data model should start with `model` followed by `.`. After that you should add at least one character that will represent the name of your data model. The value of `model` should always point to valid `data` object.
61
62
62
-
You can access predefined page attributes via `Page.Title`, `Page.Url`, `Page.TemplateId` and `Page.Content` for page html content. All properties of global `Page` object are case sensitive.
63
+
> More advanced details about how to work with data can be found in [page data model](/folders-structure/pages/model.html) section.
63
64
64
-
You can access custom page attributes via properties of `Page.Custom` object. It will have all the properties defibed in page metadata secrion.
65
+
### Custom attributes vs data model
65
66
66
-
#### Example
67
-
68
-
If your page file looks like this:
69
-
70
-
```markdown
71
-
url: index.html
72
-
template: default.hjs
73
-
title: Home
74
-
75
-
custom.header: header
76
-
custom.description: this is my home page
77
-
custom.logo.url: http://my.com/logo.png
78
-
79
-
---
80
-
81
-
# Welcome to my website!
82
-
```
83
-
84
-
You can access logo url using the following statement `Page.Custom.logo.url`.
85
-
86
-
There is one important point to highlight here. `Page.Custom` is predifened and case sensitive, but `logo.url` was generated dynamicaly from page metadata and it's also case sensitive.
67
+
The main difference between custom attributes and data model is how they interprete the values you provide.
68
+
-**Custom attributes** always treat the values as strings.
69
+
-**Data model** always treats the values as references to global `Data` model. It will copy all values from referenced `Data` object to current `Model` object.
[back to pages folder structure](/folders-structure/pages.html)
9
+
10
+
### Custom attributes
11
+
12
+
If predefined attributes are not enough and you want to add some extra attributes to your page, you can acheive that by using custom attributes section. The name of custom attribute should start with `custom` followed by `.`. After that you should add at least one character that will represent the name of your attribute.
13
+
14
+
15
+
#### Page object
16
+
17
+
All attributes can be accessible through global `Page` object. That object is accessible from each and every template and it always has a context of current page.
18
+
19
+
You can access predefined page attributes via `Page.Title`, `Page.Url`, `Page.TemplateId` and `Page.Content` for page html content. All properties of global `Page` object are case-sensitive.
20
+
21
+
You can access custom page attributes via properties of `Page.Custom` object. It will have all the properties defined in page metadata section.
22
+
23
+
#### Example
24
+
25
+
If your page file looks like this:
26
+
27
+
```markdown
28
+
url: index.html
29
+
template: default.hjs
30
+
title: Home
31
+
32
+
custom.header: header
33
+
custom.description: this is my home page
34
+
custom.logo.url: http://my.com/logo.png
35
+
36
+
---
37
+
38
+
# Welcome to my website!
39
+
```
40
+
41
+
You can access logo url using the following statement `Page.Custom.logo.url`.
42
+
43
+
There is one important point to highlight here. `Page.Custom` is predifened and case-sensitive, but `logo.url` was generated dynamicaly from page metadata and it's also case-sensitive.
44
+
45
+
### Custom attributes vs data model
46
+
47
+
The main difference between custom attributes and data model is how they interprete the values you provide.
48
+
-**Custom attributes** always treat all values as strings.
49
+
-**Data model** always treats all values as references to global `Data` model. It will copy all values from referenced `Data` object to current `Model` object.
[back to pages folder structure](/folders-structure/pages.html)
9
+
10
+
### Data model
11
+
12
+
In case you want to use the same template, but use different data for it, you can use page data model. The scenario here is to have different data (in terms of values) with the same structure on different pages. The name of page data model should start with `model` followed by `.`. After that you should add at least one character that will represent the name of your data model. The value of `model` should always point to valid `data` object.
13
+
14
+
15
+
#### Page object
16
+
17
+
All data models can be accessible through global `Page` object. That object is accessible from each and every template and it always has a context of current page.
18
+
19
+
You can access page data models via properties of `Page.Model` object. It will have all the properties defined in page metadata section.
Finally, the html rendered by Solidify Engine will look like this:
84
+
85
+
```html
86
+
<img src="http://mywebsite.com/banner1.png"/>
87
+
88
+
<h1>Category 1</h1>
89
+
90
+
<table>
91
+
<tr>
92
+
<th>Title</th>
93
+
<th>Price</th>
94
+
</tr>
95
+
<tr>
96
+
<td>apple</td>
97
+
<td>10</td>
98
+
</tr>
99
+
<tr>
100
+
<td>pear</td>
101
+
<td>12</td>
102
+
</tr>
103
+
</table>
104
+
```
105
+
106
+
107
+
There is one important point to highlight here. `Page.Model` is predifened and case-sensitive, but `goods` was generated dynamicaly from page metadata and it's also case-sensitive.
108
+
109
+
### Custom attributes vs data model
110
+
111
+
The main difference between custom attributes and data model is how they interprete the values you provide.
112
+
- **Custom attributes** always treats all values as strings.
113
+
- **Data model** always treats all values as references to global `Data` model. It will copy all values from referenced `Data` object to current `Model` object.
0 commit comments