---
url: /reference/models/page.md
---
# Page

Hierarchical, translatable content pages with SEO metadata, versioning and stable URL paths. Generated into `app/models/page.rb`.

## Columns

| Column | Type | Notes |
| --- | --- | --- |
| `key` | string | internal identifier, optional |
| `slug` | jsonb | translated URL slug |
| `title` | jsonb | translated title |
| `description` | jsonb | translated description |
| `content` | jsonb | ProseMirror document |
| `pageable_type` / `pageable_id` | string / bigint | polymorphic link to a content model |
| `parent_id` | bigint | tree hierarchy |
| `position` | integer | ordering among siblings |
| `image_data` | jsonb | Shrine attachment |
| `versioned` | boolean | enables [versioning](/reference/concerns/versionable), default `false` |
| `sectioned` | boolean | enables [sections](/reference/concerns/sectionable), default `false` |
| `current_path_id` | bigint | current [PagePath](/reference/models/page-path) |

## Included concerns

[Translatable](/reference/concerns/translatable) (`slug`, `title`, `description`), [Formattable](/reference/concerns/formattable), [Contentable](/reference/concerns/contentable), [Fragmentable](/reference/concerns/fragmentable), [Orderable](/reference/concerns/orderable), [Pathable](/reference/concerns/pathable), [SearchEngineOptimizable](/reference/concerns/search-engine-optimizable), [Sectionable](/reference/concerns/sectionable), [Sluggable](/reference/concerns/sluggable), [Versionable](/reference/concerns/versionable), [Keyable](/reference/concerns/keyable), plus `RecordImageUploader::Attachment(:image)` and `strip_attributes`.

## Associations

* `has_closure_tree` — parent/children hierarchy (siblings, ancestors, descendants)
* `belongs_to :pageable, polymorphic: true, optional: true` — the content model this page represents (see [Pageable](/reference/concerns/pageable))
* `has_many :versions` → [PageVersion](/reference/models/page-version)
* `has_many :paths` and `belongs_to :current_path` → [PagePath](/reference/models/page-path)
* `has_many :menu_nodes, as: :linkable` → [MenuNode](/reference/models/menu-node)

## Validations & scopes

* `title` presence; `slug` presence (unless root) and uniqueness within the parent
* `alpha_ordered` — orders by translated title in the current locale

## Notable methods

| Method | Returns |
| --- | --- |
| `full_path` | the page's current URL path |
| `find_at_full_path(path)` | class method — page lookup by path |
| `parsed_content` / `formatted_content` / `content_text` | ProseMirror content as hash / HTML / plain text |
| `current_version` / `current_content` / `current_image` | versioned content accessors |
| `seo_values` / `meta_tags` | SEO metadata with fallbacks |
| `fragments` | the [fragments](/reference/models/fragment) attached to this page key |
