| 1 |
--- |
| 2 |
title: BundleType |
| 3 |
description: Returns the bundle type of the given page, or an empty string if the page is not a page bundle. |
| 4 |
categories: [] |
| 5 |
keywords: [] |
| 6 |
params: |
| 7 |
functions_and_methods: |
| 8 |
returnType: string |
| 9 |
signatures: [PAGE.BundleType] |
| 10 |
--- |
| 11 |
|
| 12 |
A page bundle is a directory that encapsulates both content and associated [resources](g). There are two types of page bundles: [leaf bundles](g) and [branch bundles](g). See [details][]. |
| 13 |
|
| 14 |
The `BundleType` method on a `Page` object returns `branch` for branch bundles, `leaf` for leaf bundles, and an empty string if the page is not a page bundle. |
| 15 |
|
| 16 |
```tree |
| 17 |
content/ |
| 18 |
├── films/ |
| 19 |
│ ├── film-1/ |
| 20 |
│ │ ├── a.jpg |
| 21 |
│ │ └── index.md <-- leaf bundle |
| 22 |
│ ├── _index.md <-- branch bundle |
| 23 |
│ ├── b.jpg |
| 24 |
│ ├── film-2.md |
| 25 |
│ └── film-3.md |
| 26 |
└── _index.md <-- branch bundle |
| 27 |
``` |
| 28 |
|
| 29 |
To get the value within a template: |
| 30 |
|
| 31 |
```go-html-template |
| 32 |
{{ .BundleType }} |
| 33 |
``` |
| 34 |
|
| 35 |
[details]: /content-management/page-bundles/ |