@terminalfour/terminalfour-js 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +106 -0
- package/README.md +169 -0
- package/dist/cjs/element-resolver.d.ts +115 -0
- package/dist/cjs/element-resolver.d.ts.map +1 -0
- package/dist/cjs/element-resolver.js +391 -0
- package/dist/cjs/element-resolver.js.map +1 -0
- package/dist/cjs/errors.d.ts +21 -0
- package/dist/cjs/errors.d.ts.map +1 -0
- package/dist/cjs/errors.js +21 -0
- package/dist/cjs/errors.js.map +1 -0
- package/dist/cjs/handlebars.d.ts +123 -0
- package/dist/cjs/handlebars.d.ts.map +1 -0
- package/dist/cjs/handlebars.js +306 -0
- package/dist/cjs/handlebars.js.map +1 -0
- package/dist/cjs/http-client.d.ts +21 -0
- package/dist/cjs/http-client.d.ts.map +1 -0
- package/dist/cjs/http-client.js +126 -0
- package/dist/cjs/http-client.js.map +1 -0
- package/dist/cjs/index.d.ts +37 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +55 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/media-category-ref.d.ts +78 -0
- package/dist/cjs/media-category-ref.d.ts.map +1 -0
- package/dist/cjs/media-category-ref.js +184 -0
- package/dist/cjs/media-category-ref.js.map +1 -0
- package/dist/cjs/media-library.d.ts +30 -0
- package/dist/cjs/media-library.d.ts.map +1 -0
- package/dist/cjs/media-library.js +77 -0
- package/dist/cjs/media-library.js.map +1 -0
- package/dist/cjs/models/content-item.d.ts +80 -0
- package/dist/cjs/models/content-item.d.ts.map +1 -0
- package/dist/cjs/models/content-item.js +682 -0
- package/dist/cjs/models/content-item.js.map +1 -0
- package/dist/cjs/models/media-category-item.d.ts +29 -0
- package/dist/cjs/models/media-category-item.d.ts.map +1 -0
- package/dist/cjs/models/media-category-item.js +33 -0
- package/dist/cjs/models/media-category-item.js.map +1 -0
- package/dist/cjs/models/media-item.d.ts +74 -0
- package/dist/cjs/models/media-item.d.ts.map +1 -0
- package/dist/cjs/models/media-item.js +188 -0
- package/dist/cjs/models/media-item.js.map +1 -0
- package/dist/cjs/models/section-item.d.ts +58 -0
- package/dist/cjs/models/section-item.d.ts.map +1 -0
- package/dist/cjs/models/section-item.js +166 -0
- package/dist/cjs/models/section-item.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/resources/channel-resource.d.ts +112 -0
- package/dist/cjs/resources/channel-resource.d.ts.map +1 -0
- package/dist/cjs/resources/channel-resource.js +107 -0
- package/dist/cjs/resources/channel-resource.js.map +1 -0
- package/dist/cjs/resources/content-resource.d.ts +50 -0
- package/dist/cjs/resources/content-resource.d.ts.map +1 -0
- package/dist/cjs/resources/content-resource.js +286 -0
- package/dist/cjs/resources/content-resource.js.map +1 -0
- package/dist/cjs/resources/content-type-resource.d.ts +283 -0
- package/dist/cjs/resources/content-type-resource.d.ts.map +1 -0
- package/dist/cjs/resources/content-type-resource.js +970 -0
- package/dist/cjs/resources/content-type-resource.js.map +1 -0
- package/dist/cjs/resources/group-resource.d.ts +96 -0
- package/dist/cjs/resources/group-resource.d.ts.map +1 -0
- package/dist/cjs/resources/group-resource.js +213 -0
- package/dist/cjs/resources/group-resource.js.map +1 -0
- package/dist/cjs/resources/list-resource.d.ts +111 -0
- package/dist/cjs/resources/list-resource.d.ts.map +1 -0
- package/dist/cjs/resources/list-resource.js +179 -0
- package/dist/cjs/resources/list-resource.js.map +1 -0
- package/dist/cjs/resources/media-resource.d.ts +69 -0
- package/dist/cjs/resources/media-resource.d.ts.map +1 -0
- package/dist/cjs/resources/media-resource.js +210 -0
- package/dist/cjs/resources/media-resource.js.map +1 -0
- package/dist/cjs/resources/media-type-resource.d.ts +70 -0
- package/dist/cjs/resources/media-type-resource.d.ts.map +1 -0
- package/dist/cjs/resources/media-type-resource.js +195 -0
- package/dist/cjs/resources/media-type-resource.js.map +1 -0
- package/dist/cjs/resources/navigation-resource.d.ts +664 -0
- package/dist/cjs/resources/navigation-resource.d.ts.map +1 -0
- package/dist/cjs/resources/navigation-resource.js +2349 -0
- package/dist/cjs/resources/navigation-resource.js.map +1 -0
- package/dist/cjs/resources/page-layout-resource.d.ts +83 -0
- package/dist/cjs/resources/page-layout-resource.d.ts.map +1 -0
- package/dist/cjs/resources/page-layout-resource.js +214 -0
- package/dist/cjs/resources/page-layout-resource.js.map +1 -0
- package/dist/cjs/resources/user-resource.d.ts +126 -0
- package/dist/cjs/resources/user-resource.d.ts.map +1 -0
- package/dist/cjs/resources/user-resource.js +317 -0
- package/dist/cjs/resources/user-resource.js.map +1 -0
- package/dist/cjs/section-ref.d.ts +185 -0
- package/dist/cjs/section-ref.d.ts.map +1 -0
- package/dist/cjs/section-ref.js +813 -0
- package/dist/cjs/section-ref.js.map +1 -0
- package/dist/cjs/site-structure.d.ts +18 -0
- package/dist/cjs/site-structure.d.ts.map +1 -0
- package/dist/cjs/site-structure.js +57 -0
- package/dist/cjs/site-structure.js.map +1 -0
- package/dist/cjs/t4-client.d.ts +121 -0
- package/dist/cjs/t4-client.d.ts.map +1 -0
- package/dist/cjs/t4-client.js +190 -0
- package/dist/cjs/t4-client.js.map +1 -0
- package/dist/cjs/type-registry.d.ts +31 -0
- package/dist/cjs/type-registry.d.ts.map +1 -0
- package/dist/cjs/type-registry.js +76 -0
- package/dist/cjs/type-registry.js.map +1 -0
- package/dist/cjs/types.d.ts +211 -0
- package/dist/cjs/types.d.ts.map +1 -0
- package/dist/cjs/types.js +3 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/utils.d.ts +147 -0
- package/dist/cjs/utils.d.ts.map +1 -0
- package/dist/cjs/utils.js +408 -0
- package/dist/cjs/utils.js.map +1 -0
- package/dist/esm/element-resolver.d.ts +115 -0
- package/dist/esm/element-resolver.d.ts.map +1 -0
- package/dist/esm/element-resolver.js +387 -0
- package/dist/esm/element-resolver.js.map +1 -0
- package/dist/esm/errors.d.ts +21 -0
- package/dist/esm/errors.d.ts.map +1 -0
- package/dist/esm/errors.js +17 -0
- package/dist/esm/errors.js.map +1 -0
- package/dist/esm/handlebars.d.ts +123 -0
- package/dist/esm/handlebars.d.ts.map +1 -0
- package/dist/esm/handlebars.js +300 -0
- package/dist/esm/handlebars.js.map +1 -0
- package/dist/esm/http-client.d.ts +21 -0
- package/dist/esm/http-client.d.ts.map +1 -0
- package/dist/esm/http-client.js +122 -0
- package/dist/esm/http-client.js.map +1 -0
- package/dist/esm/index.d.ts +37 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +26 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/media-category-ref.d.ts +78 -0
- package/dist/esm/media-category-ref.d.ts.map +1 -0
- package/dist/esm/media-category-ref.js +180 -0
- package/dist/esm/media-category-ref.js.map +1 -0
- package/dist/esm/media-library.d.ts +30 -0
- package/dist/esm/media-library.d.ts.map +1 -0
- package/dist/esm/media-library.js +73 -0
- package/dist/esm/media-library.js.map +1 -0
- package/dist/esm/models/content-item.d.ts +80 -0
- package/dist/esm/models/content-item.d.ts.map +1 -0
- package/dist/esm/models/content-item.js +676 -0
- package/dist/esm/models/content-item.js.map +1 -0
- package/dist/esm/models/media-category-item.d.ts +29 -0
- package/dist/esm/models/media-category-item.d.ts.map +1 -0
- package/dist/esm/models/media-category-item.js +29 -0
- package/dist/esm/models/media-category-item.js.map +1 -0
- package/dist/esm/models/media-item.d.ts +74 -0
- package/dist/esm/models/media-item.d.ts.map +1 -0
- package/dist/esm/models/media-item.js +184 -0
- package/dist/esm/models/media-item.js.map +1 -0
- package/dist/esm/models/section-item.d.ts +58 -0
- package/dist/esm/models/section-item.d.ts.map +1 -0
- package/dist/esm/models/section-item.js +162 -0
- package/dist/esm/models/section-item.js.map +1 -0
- package/dist/esm/resources/channel-resource.d.ts +112 -0
- package/dist/esm/resources/channel-resource.d.ts.map +1 -0
- package/dist/esm/resources/channel-resource.js +102 -0
- package/dist/esm/resources/channel-resource.js.map +1 -0
- package/dist/esm/resources/content-resource.d.ts +50 -0
- package/dist/esm/resources/content-resource.d.ts.map +1 -0
- package/dist/esm/resources/content-resource.js +282 -0
- package/dist/esm/resources/content-resource.js.map +1 -0
- package/dist/esm/resources/content-type-resource.d.ts +283 -0
- package/dist/esm/resources/content-type-resource.d.ts.map +1 -0
- package/dist/esm/resources/content-type-resource.js +964 -0
- package/dist/esm/resources/content-type-resource.js.map +1 -0
- package/dist/esm/resources/group-resource.d.ts +96 -0
- package/dist/esm/resources/group-resource.d.ts.map +1 -0
- package/dist/esm/resources/group-resource.js +208 -0
- package/dist/esm/resources/group-resource.js.map +1 -0
- package/dist/esm/resources/list-resource.d.ts +111 -0
- package/dist/esm/resources/list-resource.d.ts.map +1 -0
- package/dist/esm/resources/list-resource.js +174 -0
- package/dist/esm/resources/list-resource.js.map +1 -0
- package/dist/esm/resources/media-resource.d.ts +69 -0
- package/dist/esm/resources/media-resource.d.ts.map +1 -0
- package/dist/esm/resources/media-resource.js +206 -0
- package/dist/esm/resources/media-resource.js.map +1 -0
- package/dist/esm/resources/media-type-resource.d.ts +70 -0
- package/dist/esm/resources/media-type-resource.d.ts.map +1 -0
- package/dist/esm/resources/media-type-resource.js +190 -0
- package/dist/esm/resources/media-type-resource.js.map +1 -0
- package/dist/esm/resources/navigation-resource.d.ts +664 -0
- package/dist/esm/resources/navigation-resource.d.ts.map +1 -0
- package/dist/esm/resources/navigation-resource.js +2344 -0
- package/dist/esm/resources/navigation-resource.js.map +1 -0
- package/dist/esm/resources/page-layout-resource.d.ts +83 -0
- package/dist/esm/resources/page-layout-resource.d.ts.map +1 -0
- package/dist/esm/resources/page-layout-resource.js +209 -0
- package/dist/esm/resources/page-layout-resource.js.map +1 -0
- package/dist/esm/resources/user-resource.d.ts +126 -0
- package/dist/esm/resources/user-resource.d.ts.map +1 -0
- package/dist/esm/resources/user-resource.js +312 -0
- package/dist/esm/resources/user-resource.js.map +1 -0
- package/dist/esm/section-ref.d.ts +185 -0
- package/dist/esm/section-ref.d.ts.map +1 -0
- package/dist/esm/section-ref.js +808 -0
- package/dist/esm/section-ref.js.map +1 -0
- package/dist/esm/site-structure.d.ts +18 -0
- package/dist/esm/site-structure.d.ts.map +1 -0
- package/dist/esm/site-structure.js +53 -0
- package/dist/esm/site-structure.js.map +1 -0
- package/dist/esm/t4-client.d.ts +121 -0
- package/dist/esm/t4-client.d.ts.map +1 -0
- package/dist/esm/t4-client.js +186 -0
- package/dist/esm/t4-client.js.map +1 -0
- package/dist/esm/type-registry.d.ts +31 -0
- package/dist/esm/type-registry.d.ts.map +1 -0
- package/dist/esm/type-registry.js +72 -0
- package/dist/esm/type-registry.js.map +1 -0
- package/dist/esm/types.d.ts +211 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/utils.d.ts +147 -0
- package/dist/esm/utils.d.ts.map +1 -0
- package/dist/esm/utils.js +355 -0
- package/dist/esm/utils.js.map +1 -0
- package/docs/channels.md +62 -0
- package/docs/content-types.md +313 -0
- package/docs/content.md +199 -0
- package/docs/error-handling.md +86 -0
- package/docs/getting-started.md +146 -0
- package/docs/groups-and-users.md +167 -0
- package/docs/handlebars.md +145 -0
- package/docs/lists.md +98 -0
- package/docs/media-types.md +111 -0
- package/docs/media.md +169 -0
- package/docs/navigation/a-to-z.md +62 -0
- package/docs/navigation/breadcrumbs.md +67 -0
- package/docs/navigation/css-selector.md +53 -0
- package/docs/navigation/generate-file.md +48 -0
- package/docs/navigation/keyword-search.md +134 -0
- package/docs/navigation/language-switcher.md +37 -0
- package/docs/navigation/link-menu.md +105 -0
- package/docs/navigation/pagination.md +80 -0
- package/docs/navigation/previous-next-fulltext.md +43 -0
- package/docs/navigation/publish-to-one-file.md +93 -0
- package/docs/navigation/related-content.md +79 -0
- package/docs/navigation/related-section-branch.md +31 -0
- package/docs/navigation/return-to-index.md +35 -0
- package/docs/navigation/section-details.md +51 -0
- package/docs/navigation/section-iterator.md +33 -0
- package/docs/navigation/section-meta-info.md +39 -0
- package/docs/navigation/site-map.md +58 -0
- package/docs/navigation/top-content.md +80 -0
- package/docs/navigation/top-stories.md +47 -0
- package/docs/navigation.md +134 -0
- package/docs/page-layouts.md +71 -0
- package/docs/sections.md +224 -0
- package/docs/typescript.md +124 -0
- package/package.json +64 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Pagination
|
|
2
|
+
|
|
3
|
+
Fetch content from a branch or section and split it across pages with navigation links.
|
|
4
|
+
|
|
5
|
+
[Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/pagination-navigation-object/)
|
|
6
|
+
|
|
7
|
+
## Create
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
await t4.navigation.create({
|
|
11
|
+
type: 'pagination',
|
|
12
|
+
name: 'Article Pagination',
|
|
13
|
+
properties: {
|
|
14
|
+
contentTypeId: 67,
|
|
15
|
+
fetchMethod: 'branch',
|
|
16
|
+
section: 233,
|
|
17
|
+
numToRecurse: 3,
|
|
18
|
+
contentItemsPerPage: 10,
|
|
19
|
+
maxContentItems: 100,
|
|
20
|
+
maxLinksPerPage: 5,
|
|
21
|
+
altLayoutName: 'text/json',
|
|
22
|
+
searchHiddenSections: true,
|
|
23
|
+
beforeHtml: '<nav>',
|
|
24
|
+
afterHtml: '</nav>',
|
|
25
|
+
beforePaginationHtml: '<ul>',
|
|
26
|
+
afterPaginationHtml: '</ul>',
|
|
27
|
+
betweenPaginationHtml: ' | ',
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Fetch method summary
|
|
33
|
+
|
|
34
|
+
| `fetchMethod` | `section` | `level` | `numToRecurse` |
|
|
35
|
+
|---|---|---|---|
|
|
36
|
+
| `'current'` | The SDK sets it to `0`. | The SDK sets it to `0`. | The SDK sets it to `0`. |
|
|
37
|
+
| `'current-branch'` | The SDK sets it to `0`. | The SDK sets it to `0`. | You can set it. |
|
|
38
|
+
| `'branch'` | Required and validated. | The SDK sets it to `0`. | You can set it. |
|
|
39
|
+
| `'branch-at-level'` | Required and validated. | You can set it. | You can set it. |
|
|
40
|
+
| `'section'` | Required and validated. | The SDK sets it to `0`. | The SDK sets it to `0`. |
|
|
41
|
+
|
|
42
|
+
## Properties
|
|
43
|
+
|
|
44
|
+
### Fetch scope
|
|
45
|
+
|
|
46
|
+
| Property | Type | Default | Description |
|
|
47
|
+
|---|---|---|---|
|
|
48
|
+
| `contentTypeId` | `number` | *required* | Content Type ID to paginate. |
|
|
49
|
+
| `fetchMethod` | `string` | `'current'` | Fetch scope: `'current'`, `'current-branch'`, `'branch'`, `'branch-at-level'`, or `'section'`. |
|
|
50
|
+
| `section` | `number` | `n/a` | Section ID for `'branch'`, `'branch-at-level'`, or `'section'`. |
|
|
51
|
+
| `level` | `number` | `0` | Level for `'branch-at-level'`. |
|
|
52
|
+
| `numToRecurse` | `number` | `0` | Recursion depth for `'current-branch'`, `'branch'`, or `'branch-at-level'`. |
|
|
53
|
+
| `searchHiddenSections` | `boolean` | `false` | Includes hidden sections in the search. |
|
|
54
|
+
|
|
55
|
+
### Pagination and layout
|
|
56
|
+
|
|
57
|
+
| Property | Type | Default | Description |
|
|
58
|
+
|---|---|---|---|
|
|
59
|
+
| `contentItemsPerPage` | `number` | `0` | Items per page. `0` disables pagination. |
|
|
60
|
+
| `maxContentItems` | `number` | `0` | Maximum total items. `0` sets no limit. |
|
|
61
|
+
| `maxLinksPerPage` | `number` | `0` | Maximum pagination links. `0` shows all links. |
|
|
62
|
+
| `altLayoutName` | `string` | `''` | Alternative content layout name. |
|
|
63
|
+
|
|
64
|
+
### Output HTML
|
|
65
|
+
|
|
66
|
+
| Property | Type | Default | Description |
|
|
67
|
+
|---|---|---|---|
|
|
68
|
+
| `beforeHtml` | `string` | `''` | HTML before content. |
|
|
69
|
+
| `afterHtml` | `string` | `''` | HTML after content. |
|
|
70
|
+
| `beforePaginationHtml` | `string` | `''` | HTML before pagination links. |
|
|
71
|
+
| `afterPaginationHtml` | `string` | `''` | HTML after pagination links. |
|
|
72
|
+
| `betweenPaginationHtml` | `string` | `''` | HTML between pagination links. |
|
|
73
|
+
|
|
74
|
+
## Validation
|
|
75
|
+
|
|
76
|
+
- `contentTypeId` is required and validated.
|
|
77
|
+
- When provided, `altLayoutName` is validated against the content type's layouts.
|
|
78
|
+
- The SDK validates `section` when the selected fetch method requires it.
|
|
79
|
+
|
|
80
|
+
[Back to Navigation](../navigation.md)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Previous/Next Fulltext Content
|
|
2
|
+
|
|
3
|
+
Link sequential fulltext content items within a section.
|
|
4
|
+
|
|
5
|
+
[Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/previousnext-fulltext-content-navigation-object/)
|
|
6
|
+
|
|
7
|
+
## Create
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
await t4.navigation.create({
|
|
11
|
+
type: 'previous-next-fulltext',
|
|
12
|
+
name: 'Article Nav',
|
|
13
|
+
properties: {
|
|
14
|
+
type: 'both',
|
|
15
|
+
altLayoutName: 'text/nav',
|
|
16
|
+
skipNonFulltextContent: true,
|
|
17
|
+
onlyLinkToContentWithNav: false,
|
|
18
|
+
sameContentTypeRestriction: true,
|
|
19
|
+
displayOnBoundary: false,
|
|
20
|
+
displayContentNameAsTitle: true,
|
|
21
|
+
previousHtml: '« Previous',
|
|
22
|
+
betweenHtml: ' | ',
|
|
23
|
+
nextHtml: 'Next »',
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Properties
|
|
29
|
+
|
|
30
|
+
| Property | Type | Default | Description |
|
|
31
|
+
|---|---|---|---|
|
|
32
|
+
| `type` | `string` | `'previous'` | Link direction: `'previous'`, `'next'`, or `'both'`. |
|
|
33
|
+
| `altLayoutName` | `string` | `''` | Alternative content layout name. |
|
|
34
|
+
| `skipNonFulltextContent` | `boolean` | `false` | Skips content without fulltext. |
|
|
35
|
+
| `onlyLinkToContentWithNav` | `boolean` | `false` | Links only to content that also has previous/next navigation. |
|
|
36
|
+
| `sameContentTypeRestriction` | `boolean` | `false` | Restricts links to the same content type. |
|
|
37
|
+
| `displayOnBoundary` | `boolean` | `false` | Displays links at the first and last boundaries. |
|
|
38
|
+
| `displayContentNameAsTitle` | `boolean` | `false` | Uses the content name as the link title. |
|
|
39
|
+
| `previousHtml` | `string` | `''` | HTML for the previous link. |
|
|
40
|
+
| `betweenHtml` | `string` | `''` | HTML between links. |
|
|
41
|
+
| `nextHtml` | `string` | `''` | HTML for the next link. |
|
|
42
|
+
|
|
43
|
+
[Back to Navigation](../navigation.md)
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Publish to One File
|
|
2
|
+
|
|
3
|
+
Draw all content below a section, including content from child sections, into one page.
|
|
4
|
+
|
|
5
|
+
[Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/publish-to-one-file-navigation-object/)
|
|
6
|
+
|
|
7
|
+
## Create
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
await t4.navigation.create({
|
|
11
|
+
type: 'publish-to-one-file',
|
|
12
|
+
name: 'All Content',
|
|
13
|
+
properties: {
|
|
14
|
+
contentTypeId: 38,
|
|
15
|
+
startSection: 'specific',
|
|
16
|
+
section: 7725,
|
|
17
|
+
showHiddenSections: true,
|
|
18
|
+
levelsToRecurse: 10,
|
|
19
|
+
beforeHtml: '<div>',
|
|
20
|
+
afterHtml: '</div>',
|
|
21
|
+
showSectionName: true,
|
|
22
|
+
showNameForHidden: true,
|
|
23
|
+
beforeSectionName: '<h3>',
|
|
24
|
+
afterSectionName: '</h3>',
|
|
25
|
+
surroundingPageLayout: 344,
|
|
26
|
+
altLayoutName: 'text/foo',
|
|
27
|
+
enableCaching: true,
|
|
28
|
+
pagination: true,
|
|
29
|
+
contentPerPage: 10,
|
|
30
|
+
beforePaginationHtml: '<div class="pagination">',
|
|
31
|
+
betweenPaginationHtml: '|',
|
|
32
|
+
afterPaginationHtml: '</div>',
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Properties
|
|
38
|
+
|
|
39
|
+
### Common properties
|
|
40
|
+
|
|
41
|
+
| Property | Type | Default | Description |
|
|
42
|
+
|---|---|---|---|
|
|
43
|
+
| `contentTypeId` | `number \| null` | `null` | Content Type ID. `null` includes all content types. |
|
|
44
|
+
| `startSection` | `string` | `'current'` | Content source: `'current'`, `'specific'`, or `'element'`. |
|
|
45
|
+
| `showHiddenSections` | `boolean` | `false` | Includes hidden sections. |
|
|
46
|
+
| `levelsToRecurse` | `number` | `1` | Number of levels to recurse. |
|
|
47
|
+
| `beforeHtml` | `string` | `''` | HTML before content. |
|
|
48
|
+
| `afterHtml` | `string` | `''` | HTML after content. |
|
|
49
|
+
| `showSectionName` | `boolean` | `false` | Displays section names in the output. |
|
|
50
|
+
| `surroundingPageLayout` | `number` | `n/a` | Page Layout ID. |
|
|
51
|
+
| `altLayoutName` | `string` | `''` | Alternative content layout name. |
|
|
52
|
+
| `enableCaching` | `boolean` | `true` | Controls output caching. |
|
|
53
|
+
| `pagination` | `boolean` | `false` | Splits output across pages. |
|
|
54
|
+
|
|
55
|
+
### When `startSection` is `'specific'`
|
|
56
|
+
|
|
57
|
+
| Property | Type | Description |
|
|
58
|
+
|---|---|---|
|
|
59
|
+
| `section` | `number` | Required section ID. |
|
|
60
|
+
|
|
61
|
+
### When `startSection` is `'element'`
|
|
62
|
+
|
|
63
|
+
| Property | Type | Description |
|
|
64
|
+
|---|---|---|
|
|
65
|
+
| `startSectionElement` | `string` | Free-text content element name from which to derive the section. |
|
|
66
|
+
|
|
67
|
+
### When `showSectionName` is `true`
|
|
68
|
+
|
|
69
|
+
| Property | Type | Default | Description |
|
|
70
|
+
|---|---|---|---|
|
|
71
|
+
| `showNameForHidden` | `boolean` | `false` | Shows names for hidden sections. |
|
|
72
|
+
| `beforeSectionName` | `string` | `''` | HTML before each section name. |
|
|
73
|
+
| `afterSectionName` | `string` | `''` | HTML after each section name. |
|
|
74
|
+
|
|
75
|
+
### When `pagination` is `true`
|
|
76
|
+
|
|
77
|
+
| Property | Type | Default | Description |
|
|
78
|
+
|---|---|---|---|
|
|
79
|
+
| `contentPerPage` | `number` | `0` | Items per page. |
|
|
80
|
+
| `beforePaginationHtml` | `string` | `''` | HTML before pagination. |
|
|
81
|
+
| `betweenPaginationHtml` | `string` | `''` | HTML between pagination links. |
|
|
82
|
+
| `afterPaginationHtml` | `string` | `''` | HTML after pagination. |
|
|
83
|
+
|
|
84
|
+
## Validation
|
|
85
|
+
|
|
86
|
+
- When `startSection` is `'specific'`, `section` is required and validated. Do not set it for other start-section modes.
|
|
87
|
+
- Set `startSectionElement` only when `startSection` is `'element'`.
|
|
88
|
+
- Set `showNameForHidden`, `beforeSectionName`, and `afterSectionName` only when `showSectionName` is `true`.
|
|
89
|
+
- Set `contentPerPage` and the pagination HTML fields only when `pagination` is `true`.
|
|
90
|
+
- The SDK validates `surroundingPageLayout` against page layouts.
|
|
91
|
+
- The SDK validates `contentTypeId` when it is not `null`.
|
|
92
|
+
|
|
93
|
+
[Back to Navigation](../navigation.md)
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Related Content
|
|
2
|
+
|
|
3
|
+
Fetch and display content from the current section, a specific section, or a named child section.
|
|
4
|
+
|
|
5
|
+
[Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/related-content-navigation-object/)
|
|
6
|
+
|
|
7
|
+
## Create
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
// Current section
|
|
11
|
+
await t4.navigation.create({
|
|
12
|
+
type: 'related-content',
|
|
13
|
+
name: 'Related',
|
|
14
|
+
properties: { fetchMethod: 'current', title: 'Related Items' },
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// Specific section
|
|
18
|
+
await t4.navigation.create({
|
|
19
|
+
type: 'related-content',
|
|
20
|
+
name: 'Related',
|
|
21
|
+
properties: {
|
|
22
|
+
fetchMethod: 'section',
|
|
23
|
+
section: 235,
|
|
24
|
+
altLayoutName: 'text/foo',
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// Child section
|
|
29
|
+
await t4.navigation.create({
|
|
30
|
+
type: 'related-content',
|
|
31
|
+
name: 'Related',
|
|
32
|
+
properties: {
|
|
33
|
+
fetchMethod: 'child',
|
|
34
|
+
childSectionName: 'Related Child',
|
|
35
|
+
contentTypeIds: [67, 363],
|
|
36
|
+
display: 5,
|
|
37
|
+
recurseChildSection: true,
|
|
38
|
+
altLayoutName: 'text/foo',
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Properties
|
|
44
|
+
|
|
45
|
+
### Common properties
|
|
46
|
+
|
|
47
|
+
| Property | Type | Default | Description |
|
|
48
|
+
|---|---|---|---|
|
|
49
|
+
| `fetchMethod` | `string` | `'current'` | Content source: `'current'`, `'section'`, or `'child'`. |
|
|
50
|
+
| `title` | `string` | `''` | Title text. |
|
|
51
|
+
| `altLayoutName` | `string` | `''` | Alternative content layout name. |
|
|
52
|
+
| `beforeHtml` | `string` | `''` | HTML before content. |
|
|
53
|
+
| `afterHtml` | `string` | `''` | HTML after content. |
|
|
54
|
+
|
|
55
|
+
### When `fetchMethod` is `'section'`
|
|
56
|
+
|
|
57
|
+
| Property | Type | Description |
|
|
58
|
+
|---|---|---|
|
|
59
|
+
| `section` | `number` | Required section ID. |
|
|
60
|
+
|
|
61
|
+
### When `fetchMethod` is `'child'`
|
|
62
|
+
|
|
63
|
+
| Property | Type | Default | Description |
|
|
64
|
+
|---|---|---|---|
|
|
65
|
+
| `childSectionName` | `string` | `''` | Child section name to search. |
|
|
66
|
+
| `contentTypeIds` | `number[]` | *required* | Content Type IDs by which to filter. |
|
|
67
|
+
| `display` | `number` | `0` | Number of items. `0` displays all items. |
|
|
68
|
+
| `recurseChildSection` | `boolean` | `false` | Searches recursively through child sections. |
|
|
69
|
+
|
|
70
|
+
## Validation
|
|
71
|
+
|
|
72
|
+
- When `fetchMethod` is `'section'`, `section` is required and validated.
|
|
73
|
+
- When `fetchMethod` is `'child'`, `contentTypeIds` is required and validated.
|
|
74
|
+
|
|
75
|
+
## Caching
|
|
76
|
+
|
|
77
|
+
Caching is enabled by default.
|
|
78
|
+
|
|
79
|
+
[Back to Navigation](../navigation.md)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Related Section Branch
|
|
2
|
+
|
|
3
|
+
Link to a named child section across branches.
|
|
4
|
+
|
|
5
|
+
[Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/related-section-branch-navigation-object/)
|
|
6
|
+
|
|
7
|
+
## Create
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
await t4.navigation.create({
|
|
11
|
+
type: 'related-section-branch',
|
|
12
|
+
name: 'News Link',
|
|
13
|
+
properties: {
|
|
14
|
+
childSectionName: 'news',
|
|
15
|
+
linkText: 'View News',
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Properties
|
|
21
|
+
|
|
22
|
+
| Property | Type | Default | Description |
|
|
23
|
+
|---|---|---|---|
|
|
24
|
+
| `childSectionName` | `string` | `''` | Name of the child section to link to. |
|
|
25
|
+
| `linkText` | `string` | `''` | Displayed link text. |
|
|
26
|
+
|
|
27
|
+
## Validation
|
|
28
|
+
|
|
29
|
+
No validation applies. Both fields are optional free-text strings.
|
|
30
|
+
|
|
31
|
+
[Back to Navigation](../navigation.md)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Return to Index
|
|
2
|
+
|
|
3
|
+
Link from a fulltext content page back to its section index.
|
|
4
|
+
|
|
5
|
+
[Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/return-to-index-navigation-object/)
|
|
6
|
+
|
|
7
|
+
## Create
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
await t4.navigation.create({
|
|
11
|
+
type: 'return-to-index',
|
|
12
|
+
name: 'Back Link',
|
|
13
|
+
properties: {
|
|
14
|
+
linkText: 'Back to...',
|
|
15
|
+
appendSectionName: true,
|
|
16
|
+
scrollToContent: true,
|
|
17
|
+
linkTarget: '_blank',
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Properties
|
|
23
|
+
|
|
24
|
+
| Property | Type | Default | Description |
|
|
25
|
+
|---|---|---|---|
|
|
26
|
+
| `linkText` | `string` | `''` | Link text. |
|
|
27
|
+
| `appendSectionName` | `boolean` | `false` | Appends the section name to the link text. |
|
|
28
|
+
| `scrollToContent` | `boolean` | `false` | Scrolls to the content when clicked. |
|
|
29
|
+
| `linkTarget` | `string` | `''` | Link target attribute, such as `'_blank'`. |
|
|
30
|
+
|
|
31
|
+
## Validation
|
|
32
|
+
|
|
33
|
+
All fields are optional.
|
|
34
|
+
|
|
35
|
+
[Back to Navigation](../navigation.md)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Section Details
|
|
2
|
+
|
|
3
|
+
Output a section's ID, name, path, or link.
|
|
4
|
+
|
|
5
|
+
[Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/section-details-navigation-object/)
|
|
6
|
+
|
|
7
|
+
## Create
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
await t4.navigation.create({
|
|
11
|
+
type: 'section-details',
|
|
12
|
+
name: 'Show Section Path',
|
|
13
|
+
properties: {
|
|
14
|
+
detailMethod: 'section',
|
|
15
|
+
section: 233,
|
|
16
|
+
displayType: 'path',
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Properties
|
|
22
|
+
|
|
23
|
+
### Common properties
|
|
24
|
+
|
|
25
|
+
| Property | Type | Default | Description |
|
|
26
|
+
|---|---|---|---|
|
|
27
|
+
| `detailMethod` | `string` | `'current'` | Section selector: `'current'`, `'level'`, or `'section'`. |
|
|
28
|
+
| `displayType` | `string` | `'id'` | Output value: `'id'`, `'name'`, `'path'`, or `'link'`. |
|
|
29
|
+
|
|
30
|
+
### When `detailMethod` is `'level'`
|
|
31
|
+
|
|
32
|
+
| Property | Type | Default | Description |
|
|
33
|
+
|---|---|---|---|
|
|
34
|
+
| `level` | `number` | `0` | Section level. |
|
|
35
|
+
|
|
36
|
+
### When `detailMethod` is `'section'`
|
|
37
|
+
|
|
38
|
+
| Property | Type | Default | Description |
|
|
39
|
+
|---|---|---|---|
|
|
40
|
+
| `section` | `number` | `n/a` | Required section ID. |
|
|
41
|
+
|
|
42
|
+
## Validation
|
|
43
|
+
|
|
44
|
+
- Set `level` only when `detailMethod` is `'level'`.
|
|
45
|
+
- When `detailMethod` is `'section'`, `section` is required and validated. Do not set it for other methods.
|
|
46
|
+
|
|
47
|
+
## Read behavior
|
|
48
|
+
|
|
49
|
+
The SDK hides fields that do not apply to the current method.
|
|
50
|
+
|
|
51
|
+
[Back to Navigation](../navigation.md)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Section Iterator
|
|
2
|
+
|
|
3
|
+
Iterate over sections to output content from multiple sections, with configurable HTML around and between them.
|
|
4
|
+
|
|
5
|
+
[Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/section-iterator-navigation-object/)
|
|
6
|
+
|
|
7
|
+
## Create
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
await t4.navigation.create({
|
|
11
|
+
type: 'section-iterator',
|
|
12
|
+
name: 'My Iterator',
|
|
13
|
+
properties: {
|
|
14
|
+
beforeHtml: '<ul>',
|
|
15
|
+
betweenHtml: '<li>',
|
|
16
|
+
afterHtml: '</ul>',
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Properties
|
|
22
|
+
|
|
23
|
+
| Property | Type | Default | Description |
|
|
24
|
+
|---|---|---|---|
|
|
25
|
+
| `beforeHtml` | `string` | `''` | HTML before the output. |
|
|
26
|
+
| `betweenHtml` | `string` | `''` | HTML between sections. |
|
|
27
|
+
| `afterHtml` | `string` | `''` | HTML after the output. |
|
|
28
|
+
|
|
29
|
+
## Validation
|
|
30
|
+
|
|
31
|
+
No validation applies. All fields are optional strings.
|
|
32
|
+
|
|
33
|
+
[Back to Navigation](../navigation.md)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Section Meta Info
|
|
2
|
+
|
|
3
|
+
Output the value of one section metadata tag.
|
|
4
|
+
|
|
5
|
+
[Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/section-meta-info-navigation-object/)
|
|
6
|
+
|
|
7
|
+
## Create
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
await t4.navigation.create({
|
|
11
|
+
type: 'section-meta-info',
|
|
12
|
+
name: 'OG Description',
|
|
13
|
+
properties: {
|
|
14
|
+
metaType: 'og:description',
|
|
15
|
+
dateFormat: 'dd.MM.yyyy',
|
|
16
|
+
beforeHtml: '<meta content="',
|
|
17
|
+
afterHtml: '">',
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Properties
|
|
23
|
+
|
|
24
|
+
| Property | Type | Default | Description |
|
|
25
|
+
|---|---|---|---|
|
|
26
|
+
| `metaType` | `string` | *required* | Meta tag name, such as `'description'` or `'og:title'`. |
|
|
27
|
+
| `dateFormat` | `string` | `''` | Date format string, such as `'dd.MM.yyyy'`. |
|
|
28
|
+
| `beforeHtml` | `string` | `''` | HTML before the output. |
|
|
29
|
+
| `afterHtml` | `string` | `''` | HTML after the output. |
|
|
30
|
+
|
|
31
|
+
## Validation
|
|
32
|
+
|
|
33
|
+
`metaType` is required and validated against the meta tag definitions from `GET /meta/level`.
|
|
34
|
+
|
|
35
|
+
## Read behavior
|
|
36
|
+
|
|
37
|
+
The SDK resolves the numeric ID back to the metadata tag name.
|
|
38
|
+
|
|
39
|
+
[Back to Navigation](../navigation.md)
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Site Map
|
|
2
|
+
|
|
3
|
+
Output a hierarchical site map with optional content counts.
|
|
4
|
+
|
|
5
|
+
[Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/site-map-navigation-object/)
|
|
6
|
+
|
|
7
|
+
## Create
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
await t4.navigation.create({
|
|
11
|
+
type: 'site-map',
|
|
12
|
+
name: 'Full Site Map',
|
|
13
|
+
properties: {
|
|
14
|
+
startSection: 233,
|
|
15
|
+
levels: 5,
|
|
16
|
+
childSectionLinks: true,
|
|
17
|
+
enableContentCount: true,
|
|
18
|
+
contentTypeIds: [67, 363],
|
|
19
|
+
maxLevelsToCount: 10,
|
|
20
|
+
countRecursively: true,
|
|
21
|
+
htmlBeforeContentCount: '(',
|
|
22
|
+
htmlAfterContentCount: ')',
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Properties
|
|
28
|
+
|
|
29
|
+
### Common properties
|
|
30
|
+
|
|
31
|
+
| Property | Type | Default | Description |
|
|
32
|
+
|---|---|---|---|
|
|
33
|
+
| `startSection` | `number` | `0` | Starting section ID. `0` starts at the channel root. |
|
|
34
|
+
| `levels` | `number` | `0` | Number of levels. `0` includes all levels. |
|
|
35
|
+
| `childSectionLinks` | `boolean` | `false` | Shows links to child sections. |
|
|
36
|
+
| `enableContentCount` | `boolean` | `false` | Adds content counts. |
|
|
37
|
+
|
|
38
|
+
### When `enableContentCount` is `true`
|
|
39
|
+
|
|
40
|
+
| Property | Type | Default | Description |
|
|
41
|
+
|---|---|---|---|
|
|
42
|
+
| `contentTypeIds` | `number[]` | `[]` | Content Type IDs to count. An empty array includes all content types. |
|
|
43
|
+
| `maxLevelsToCount` | `number` | `''` | Maximum levels to recurse while counting. |
|
|
44
|
+
| `countRecursively` | `boolean` | `false` | Counts recursively through child sections. |
|
|
45
|
+
| `htmlBeforeContentCount` | `string` | `''` | HTML before the count. |
|
|
46
|
+
| `htmlAfterContentCount` | `string` | `''` | HTML after the count. |
|
|
47
|
+
|
|
48
|
+
## Validation
|
|
49
|
+
|
|
50
|
+
- The SDK validates `startSection` when it is a positive number.
|
|
51
|
+
- The SDK validates every ID in `contentTypeIds` and requires each content type to exist.
|
|
52
|
+
- Content-count fields throw when set without `enableContentCount: true`.
|
|
53
|
+
|
|
54
|
+
## Read behavior
|
|
55
|
+
|
|
56
|
+
The SDK hides content-count fields when `enableContentCount` is `false`.
|
|
57
|
+
|
|
58
|
+
[Back to Navigation](../navigation.md)
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Top Content
|
|
2
|
+
|
|
3
|
+
Display recent or relevant content from a section or branch, ordered by date or name.
|
|
4
|
+
|
|
5
|
+
[Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/top-content-navigation-object/)
|
|
6
|
+
|
|
7
|
+
## Create
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
await t4.navigation.create({
|
|
11
|
+
type: 'top-content',
|
|
12
|
+
name: 'Latest Articles',
|
|
13
|
+
properties: {
|
|
14
|
+
fetchMethod: 'section',
|
|
15
|
+
section: 237,
|
|
16
|
+
contentTypeIds: [67, 151],
|
|
17
|
+
channelId: 5,
|
|
18
|
+
upcomingContent: true,
|
|
19
|
+
dateElement: 'Date released',
|
|
20
|
+
ignoreDateOrdering: false,
|
|
21
|
+
numToDisplay: 5,
|
|
22
|
+
startAt: 10,
|
|
23
|
+
altLayoutName: 'text/foo',
|
|
24
|
+
title: 'Latest',
|
|
25
|
+
beforeHtml: '<ul>',
|
|
26
|
+
afterHtml: '</ul>',
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Properties
|
|
32
|
+
|
|
33
|
+
### Common properties
|
|
34
|
+
|
|
35
|
+
| Property | Type | Default | Description |
|
|
36
|
+
|---|---|---|---|
|
|
37
|
+
| `fetchMethod` | `string` | `'current'` | Content source: `'current'`, `'current-branch'`, `'branch'`, or `'section'`. |
|
|
38
|
+
| `contentTypeIds` | `number[]` | `[]` | Content Type IDs by which to filter. An empty array includes all content types. |
|
|
39
|
+
| `channelId` | `number` | `0` | Channel ID. `0` applies no channel restriction. |
|
|
40
|
+
|
|
41
|
+
### When `fetchMethod` is `'branch'` or `'section'`
|
|
42
|
+
|
|
43
|
+
| Property | Type | Default | Description |
|
|
44
|
+
|---|---|---|---|
|
|
45
|
+
| `section` | `number` | `n/a` | Required section ID. |
|
|
46
|
+
|
|
47
|
+
### Ordering and filtering
|
|
48
|
+
|
|
49
|
+
| Property | Type | Default | Description |
|
|
50
|
+
|---|---|---|---|
|
|
51
|
+
| `upcomingContent` | `boolean` | `false` | Includes upcoming or future content. |
|
|
52
|
+
| `dateElement` | `string` | `''` | Date element name for ordering and filtering. |
|
|
53
|
+
| `ignoreDateOrdering` | `boolean` | `false` | Uses Terminalfour's section order instead of date order. |
|
|
54
|
+
|
|
55
|
+
### Results and output
|
|
56
|
+
|
|
57
|
+
| Property | Type | Default | Description |
|
|
58
|
+
|---|---|---|---|
|
|
59
|
+
| `numToDisplay` | `number` | `0` | Number of items. `0` displays all items. |
|
|
60
|
+
| `startAt` | `number` | `0` | Skips this many items from the start. |
|
|
61
|
+
| `altLayoutName` | `string` | `''` | Alternative content layout name. |
|
|
62
|
+
| `title` | `string` | `''` | Title text. |
|
|
63
|
+
| `beforeHtml` | `string` | `''` | HTML before content. |
|
|
64
|
+
| `afterHtml` | `string` | `''` | HTML after content. |
|
|
65
|
+
|
|
66
|
+
## Validation
|
|
67
|
+
|
|
68
|
+
- When `fetchMethod` is `'branch'` or `'section'`, `section` is required and validated. Do not set it for the other fetch methods.
|
|
69
|
+
- The SDK validates each ID in `contentTypeIds` and requires every content type to exist.
|
|
70
|
+
- The SDK validates `channelId` when it is a positive number.
|
|
71
|
+
|
|
72
|
+
## Read behavior
|
|
73
|
+
|
|
74
|
+
The SDK hides `section` when the fetch method does not use it.
|
|
75
|
+
|
|
76
|
+
## Caching
|
|
77
|
+
|
|
78
|
+
Caching is enabled by default.
|
|
79
|
+
|
|
80
|
+
[Back to Navigation](../navigation.md)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Top Stories
|
|
2
|
+
|
|
3
|
+
Display content from one section with optional links to fulltext pages.
|
|
4
|
+
|
|
5
|
+
[Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/top-stories-navigation-object/)
|
|
6
|
+
|
|
7
|
+
## Create
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
await t4.navigation.create({
|
|
11
|
+
type: 'top-stories',
|
|
12
|
+
name: 'Latest News',
|
|
13
|
+
properties: {
|
|
14
|
+
section: 237,
|
|
15
|
+
numToShow: 10,
|
|
16
|
+
linkToFulltext: true,
|
|
17
|
+
title: 'Latest',
|
|
18
|
+
beforeMenuHtml: '<ul>',
|
|
19
|
+
afterMenuHtml: '</ul>',
|
|
20
|
+
beforeHtml: '<li>',
|
|
21
|
+
afterHtml: '</li>',
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Properties
|
|
27
|
+
|
|
28
|
+
| Property | Type | Default | Description |
|
|
29
|
+
|---|---|---|---|
|
|
30
|
+
| `section` | `number` | *required* | Section ID. |
|
|
31
|
+
| `numToShow` | `number` | `0` | Number of items. `0` displays all items. |
|
|
32
|
+
| `linkToFulltext` | `boolean` | `false` | Links items to their fulltext pages. |
|
|
33
|
+
| `title` | `string` | `''` | Title text. |
|
|
34
|
+
| `beforeMenuHtml` | `string` | `''` | HTML before the menu. |
|
|
35
|
+
| `afterMenuHtml` | `string` | `''` | HTML after the menu. |
|
|
36
|
+
| `beforeHtml` | `string` | `''` | HTML before each item. |
|
|
37
|
+
| `afterHtml` | `string` | `''` | HTML after each item. |
|
|
38
|
+
|
|
39
|
+
## Validation
|
|
40
|
+
|
|
41
|
+
`section` is required and validated.
|
|
42
|
+
|
|
43
|
+
## Caching
|
|
44
|
+
|
|
45
|
+
Caching is enabled by default.
|
|
46
|
+
|
|
47
|
+
[Back to Navigation](../navigation.md)
|