folder
konigle.models.website.folder
¶
Folder models for the Konigle SDK.
This module defines models for content folder management including hierarchical folder structure, folder types, and folder configurations.
BaseFolder
¶
Bases: BaseModel
Base class for folder models with common editable fields.
Contains fields that can be set during creation/update.
canonical_page = Field(default=None, title='Canonical Page ID', description='ID of the canonical page for SEO purposes. Must be a valid folder id')
class-attribute
instance-attribute
¶
ID of the canonical page for SEO purposes. Must be a valid folder id.
context_builders = Field(default_factory=dict, title='Context Builders', description='Context builders for dynamic content')
class-attribute
instance-attribute
¶
Context builders for dynamic content.
country_code = Field(default='US', title='Country Code', description='Country code for the folder', max_length=2)
class-attribute
instance-attribute
¶
Country code for the folder.
exclude_from_sitemap = Field(default=False, title='Exclude From Sitemap', description='Whether to exclude folder from sitemap')
class-attribute
instance-attribute
¶
Whether to exclude folder from sitemap.
folder_type = Field(FolderType.CUSTOM, title='Folder Type', description='Type of the folder for behavior control')
class-attribute
instance-attribute
¶
Type of the folder for behavior control.
handle = Field(..., max_length=255, title='Handle', description='Unique identifier for the folder used in URLs')
class-attribute
instance-attribute
¶
Unique identifier for the folder used in URLs.
json_ld = Field(default_factory=dict, title='JSON-LD', description='Manual JSON-LD override for the folder')
class-attribute
instance-attribute
¶
Manual JSON-LD override for the folder.
language = Field(default='en', title='Language', description='Language code for the folder', max_length=2)
class-attribute
instance-attribute
¶
Language code for the folder.
name = Field(..., max_length=255, title='Name', description='Folder name for display and search purposes')
class-attribute
instance-attribute
¶
Folder name for display and search purposes.
parent = Field(None, title='Parent ID', description='ID of the parent folder, NULL for root folders')
class-attribute
instance-attribute
¶
ID of the parent folder, NULL for root folders.
seo_meta = Field(default=None, title='SEO Meta', description='SEO meta information for folder pages')
class-attribute
instance-attribute
¶
SEO meta information for folder pages.
tags = Field(default_factory=list, title='Tags', description='Tags for categorization')
class-attribute
instance-attribute
¶
Tags for categorization.
template = Field(default=None, title='Template ID', description='ID of the page design template.')
class-attribute
instance-attribute
¶
ID of the page design template.
Folder
¶
Bases: BaseFolder, Resource
Content folder model for hierarchical organization.
Represents a folder with metadata, versioning, and publication status.
is_default_version = Field(False, title='Is Default Version', description='Whether this is the default version of the folder')
class-attribute
instance-attribute
¶
Whether this is the default version of the folder.
is_original_version = Field(True, title='Is Original Version', description='Whether this is the original version of the folder. Only original versions can have children.')
class-attribute
instance-attribute
¶
Whether this is the original version of the folder. Only original versions can have children.
managed = Field(False, title='Managed', description='Whether the folder is system-managed')
class-attribute
instance-attribute
¶
Whether the folder is system-managed.
pathname = Field(default=None, title='Pathname', description='Full pathname of the folder')
class-attribute
instance-attribute
¶
Full pathname of the page
preview_url = Field(default=None, title='Preview URL', description='Preview URL of the page')
class-attribute
instance-attribute
¶
Preview URL of the folder before publishing.
published = Field(True, title='Published', description='Whether the folder is visible on the website')
class-attribute
instance-attribute
¶
Whether the folder is visible on the website.
url = Field(default=None, title='URL', description='Public URL of the page')
class-attribute
instance-attribute
¶
Public URL of the folder. Results in 404 if the folder is not published.
version = Field(..., title='Version', description='Version of the folder for A/B testing')
class-attribute
instance-attribute
¶
Version of the folder for A/B testing.
change_handle(new_handle, redirect=False)
¶
Change the handle of the folder.
| PARAMETER | DESCRIPTION |
|---|---|
new_handle
|
The new handle to set for the folder.
TYPE:
|
redirect
|
Whether to create a redirect from the old handle.
TYPE:
|
Raises: ValueError: If the new handle is invalid.
publish()
¶
Publish the folder.
unpublish()
¶
Unpublish the folder.
FolderCreate
¶
Bases: BaseFolder, CreateModel
Model for creating a new folder.
Contains all required and optional fields for folder creation.
handle = Field(default=None, max_length=255, title='Handle', description='Unique identifier for the folder used in URLs')
class-attribute
instance-attribute
¶
Unique identifier for the folder used in URLs.
FolderReference
¶
FolderType
¶
Bases: str, Enum
Folder type enumeration.
FolderUpdate
¶
Bases: UpdateModel
Model for updating an existing folder.
All fields are optional for partial updates.
canonical_page = Field(default=None, title='Canonical Page ID', description='ID of the canonical page for SEO purposes')
class-attribute
instance-attribute
¶
ID of the canonical page for SEO purposes.
context_builders = Field(default=None, title='Context Builders', description='Context builders for dynamic content')
class-attribute
instance-attribute
¶
Context builders for dynamic content.
country_code = Field(default=None, title='Country Code', description='Country code for the folder', max_length=2)
class-attribute
instance-attribute
¶
Country code for the folder.
exclude_from_sitemap = Field(default=None, title='Exclude From Sitemap', description='Whether to exclude folder from sitemap')
class-attribute
instance-attribute
¶
Whether to exclude folder from sitemap.
json_ld = Field(default=None, title='JSON-LD', description='Manual JSON-LD override for the folder')
class-attribute
instance-attribute
¶
Manual JSON-LD override for the folder.
language = Field(default=None, title='Language', description='Language code for the folder', max_length=2)
class-attribute
instance-attribute
¶
Language code for the folder.
name = Field(default=None, max_length=255, title='Name', description='Folder name for display and search purposes')
class-attribute
instance-attribute
¶
Folder name for display and search purposes.
seo_meta = Field(default=None, title='SEO Meta', description='SEO meta information for folder pages')
class-attribute
instance-attribute
¶
SEO meta information for folder pages.
tags = Field(default=None, title='Tags', description='Tags for categorization')
class-attribute
instance-attribute
¶
Tags for categorization.
template = Field(default=None, title='Template ID', description='ID of the page design template.')
class-attribute
instance-attribute
¶
ID of the page design template.