```
### Empty()
Check if array or object is empty:
```html
No items
{{ items.length }} items found
No settings configured
```
## Global Data (`__data.json`)
Define global data available to all pages:
**`/templates//__data.json`**:
```json
{
"title": "My Application",
"version": "1.0.0",
"company": {
"name": "ACME Inc",
"email": "contact@acme.com"
},
"navigation": [
{ "label": "Home", "href": "/" },
{ "label": "About", "href": "/about" }
]
}
```
Access in templates:
```html
{{ $global.title }}
```
## Backend Script Data
Data returned from `BeforeRender` is merged with page data:
**`.backend.ts`**:
```typescript
function BeforeRender(request: Request): Record {
return {
user: Process("session.Get", "user"),
notifications: Process("models.notification.Get", {
wheres: [{ column: "read", value: false }],
limit: 5,
}),
serverTime: new Date().toISOString(),
};
}
```
**`.html`**:
```html
Welcome, {{ user.name }}!
{{ notifications.length }} new notifications
```
## Data Priority
When the same key exists in multiple sources, priority is:
1. **BeforeRender** (highest) - Backend script data
2. **`.json`** - Page data configuration
3. **`__data.json`** (lowest) - Global data
```typescript
// BeforeRender returns { title: "From Backend" }
// page.json has { title: "From JSON" }
// __data.json has { title: "Global Title" }
// Result: title = "From Backend"
```