ModelBlogs module
Blog
A model in the Blogs module, with 82 members for templates, 43 API properties and 91 members for admin templates.
Templates view
Properties 49
Take no arguments.
-
#
__toString()Templates only -
string - Returns the rendered HTML when the model is used in a string context.
-
#
getText() -
?string - Get the description for this blog. Also parses image and link placeholders in the process.
-
#
getOriginalFullPath() -
string - Gets the blog's own canonical path within the site, _ignoring_ any custom URL override
-
#
getAreas() -
?Collection -
#
getOriginalPath() -
string - It's an alias and deprecated! Directly use
getOriginalFullPath()instead. -
#
getOriginalFullSlug() -
string - Gets the record's own canonical slug, built from the record's data and _ignoring_ any custom URL override. Like
getFullSlug()it excludes the module path, has no leading slash, and includes ancestor slugs for hierarchical records — but it always reflects the record's real slugs rather than a custom URL. For a non-hierarchical record this equals the record's owngetSlug()value. This default concatenates whatever the ancestor walk supplies and does not judge the segments: an ancestor with no slug of its own contributes an empty segment rather than failing. A model whose callers need to tell an unresolvable chain apart from a valid one should either return an empty string from an override, asProducts\Models\ProductDescriptiondoes, or expose a separate check alongside it, asPages\Models\BasePage::hasResolvableSlugChain()does. -
#
getFullSlug() -
string - Gets the slug that addresses this record relative to its module — the portion of the URL that identifies the record itself, without the module path and without a leading slash. For a hierarchical record the slug includes the slugs of all of its ancestors joined with slashes. This is the effective slug: when a custom URL is set on the record, it _takes precedence and is returned_ here. The no-leading-slash shape describes the canonical value only. A custom URL is returned verbatim, and custom URLs are stored with a leading slash, so a record that has one returns
/my-customrather thanmy-custom; usegetOriginalFullSlug()when you need the canonical shape unconditionally. -
#
getFullPath() -
string - Gets the relative path that addresses this record within the site, including the module path and starting with a leading slash. This is the
getFullSlug()value prefixed with the route under which the module is mounted. This is the effective path: when a custom URL is set on the record, it _takes precedence and is returned_ here. Returns an empty string when the record has no custom URL andgetOriginalFullPath()cannot build one, so callers must treat an empty string as "no url" rather than as a path. Rendering it into markup or handing it to a cache or route helper would otherwise point the record at whatever the site serves at its root. -
#
getId() -
?int -
#
getName() -
?string -
#
getSlug() -
?string -
#
getAllowRss() -
bool -
#
getLockComments() -
bool -
#
getAutoPublishPosts() -
bool -
#
getAutoPublishComments() -
bool -
#
getRequireCommentatorEmail() -
bool -
#
getTags() -
?Collection<Tag> -
#
getCategories() -
?Collection<Category> -
#
getPosts() -
?Collection<Post> -
#
getSeoSettings() -
?SeoSettings -
#
getRelatedBlogs() -
?Collection<Blog> -
#
getBlogAreas() -
?Collection<BlogArea> -
#
getCustomUrl() -
?CustomUrl - Get the custom url used for the page. This will take precedence over the slugs of this page, parent page and the module.
-
#
getExternalId() -
?string -
#
isHierarchicalModel()Not in API & Jobs -
bool - Check whether a model is a hierarchical model, i.e. can have children
-
#
getOtherLanguageVersions()Templates only -
array - Fetch an associative array with other language versions of this blog The key of the array is the language code id (e.g. "en-us") and the value is the blog.
Methods 33
Take arguments. The API serialises only getters that need none.
-
#
getPostsByCategoryNames(array $names) -
Collection - Gets all posts of the current blog by given category names. It uses 'OR' condition for every passed value.
-
#
getPostsByCategorySlugs(array $slugs) -
Collection - Gets all posts of the current blog by given category slugs. It uses 'OR' condition for every passed value.
-
#
getPostsByTagNames(array $names) -
Collection - Gets all posts of the current blog by given tag names. It uses 'OR' condition for every passed value.
-
#
getPostsByTagSlugs(array $slugs) -
Collection - Gets all posts of the current blog by given tag slugs. It uses 'OR' condition for every passed value.
-
#
getPostsByAuthorNames(array $names) -
Collection - Gets all posts of the current blog by given author display names. It uses 'OR' condition for every passed value.
-
#
getPostsByAuthorSlugs(array $slugs) -
Collection - Gets all posts of the current blog by given author slugs. It uses 'OR' condition for every passed value, and matches a post when any of its credited authors qualifies. Prefer this over filtering a fetched collection in a template:
ModelsCollection::filtered()cannot express an author query, and silently narrows to the first credited author instead. Passing an empty array is a caller error and throws. A list holding only authors that have no slug yet returns an empty collection. -
#
getAreaContent(string $areaName) -
Content - Get the content of the layout area Will return a BlankContent if no content was defined
-
#
getAreaDefaultContent(string $areaName) -
Content - Get the default content of the layout area Will return a BlankContent if no content was defined
-
#
getAreaContentOrDefault(string $areaName) -
Content - Get the content of the layout area, or the default content if no content exists If no default content exists, a BlankContent will be returned
-
#
isAreaBlank(string $areaName) -
bool - Check whether the layout area with the specified name has no usable content. Resolves the area's content, falling back to its default, and reports the area as blank when no content exists at all, when the content is one of the framework's Blank objects, or when the content is empty for its category. Blank describes what is stored, not what renders: the answer comes from the stored content and never renders a template. An area can therefore be not blank and still render nothing — a record that was deleted or has no layout, a component or widget whose template outputs nothing, or text whose only content is a placeholder for a deleted image. To decide on the rendered output instead, test the result of getAreaHtml(). Emptiness cannot always be determined — Content::isEmpty() throws a RuntimeException when the content has no input type, or when its category is not one the framework knows how to answer for. Those two cases are reported as not blank, the same answer the Twig
emptytest gives. Any other failure, such as a database error, is not contained and reaches the error handler. -
#
getAreaAttributesContent(string $areaName) -
array - Gets the content of every layout area attribute. If layout area does not have attributes, returns empty array.
-
#
getAreaAttributesDefaultContent(string $areaName) -
array - Gets the default content of every layout area attribute. If layout area does not have attributes, returns empty array.
-
#
getAreaAttributesContentOrDefault(string $areaName) -
array - Gets the content (or the default content if no content exists) of every layout area attribute. If layout area does not have attributes, returns empty array.
-
#
getEntityAreaByLayoutArea(LayoutArea $area) -
?Model - Get the link record between the layout area and content for the designated layout area
-
#
hasAreaWithName(string $areaName) -
bool - Check if an area with the specified name exists for the container
-
#
getAreaType(string $areaName) -
?InputType - Get the input type for the specified layout area. Returns null if the area with the specified name could not be found.
-
#
getAreaCategory(string $areaName) -
?string - Get the category for the specified layout area. Returns null if the area with the specified name could not be found.
-
#
getAreaEditor(string $areaName) -
?string - Get the editor for the specified layout area. Returns null if the area with the specified name could not be found.
-
#
getAreaImage(string $areaName) -
Image - Get the image for the layout area with the specified name Will return a BlankImage if no image was defined
-
#
getAreaRecords(string $areaName) -
?Collection - Get the records for the layout area with the specified name
-
#
getAreaWidget(string $areaName) -
Widget - Get the widget for the layout area with the specified name Will return a BlankWidget if no image was defined
-
#
getAreaComponent(string $areaName) -
Component - Get the component for the layout area with the specified name Will return a BlankComponent if no image was defined
-
#
getAreaCollectionElements(string $areaName) -
?Collection - Get the component collection elements for the layout area with the specified name
-
#
getAreaHtml(string $areaName) -
string - Get the rendered HTML for the component area with the specified name. Adds live preview tags, if enabled.
-
#
getCategoryPostsUrl(Category $category)Templates only -
string - Get the url for all posts in a category
-
#
getAreaImageOrPlaceholder(string $areaName, int $width, int $height)Templates only -
Image - Get the image for the component area with the specified name If the image does not exist, get a placeholder image with the specified dimensions Will always return an image, even if it was not found (in that case, an empty image)
No members match the filter.
API & Jobs view
API & JobsEach property is a key in REST API responses and job payloads. Its name is the template getter without get, is or has. Methods that need arguments are not available here.
Properties 43
Read-only values on the record.
-
#
text -
?string - Get the description for this blog. Also parses image and link placeholders in the process.
-
#
originalFullPath -
string - Gets the blog's own canonical path within the site, _ignoring_ any custom URL override
-
#
areas -
?Collection -
#
originalFullSlug -
string - Gets the record's own canonical slug, built from the record's data and _ignoring_ any custom URL override. Like
getFullSlug()it excludes the module path, has no leading slash, and includes ancestor slugs for hierarchical records — but it always reflects the record's real slugs rather than a custom URL. For a non-hierarchical record this equals the record's owngetSlug()value. This default concatenates whatever the ancestor walk supplies and does not judge the segments: an ancestor with no slug of its own contributes an empty segment rather than failing. A model whose callers need to tell an unresolvable chain apart from a valid one should either return an empty string from an override, asProducts\Models\ProductDescriptiondoes, or expose a separate check alongside it, asPages\Models\BasePage::hasResolvableSlugChain()does. -
#
fullSlug -
string - Gets the slug that addresses this record relative to its module — the portion of the URL that identifies the record itself, without the module path and without a leading slash. For a hierarchical record the slug includes the slugs of all of its ancestors joined with slashes. This is the effective slug: when a custom URL is set on the record, it _takes precedence and is returned_ here. The no-leading-slash shape describes the canonical value only. A custom URL is returned verbatim, and custom URLs are stored with a leading slash, so a record that has one returns
/my-customrather thanmy-custom; usegetOriginalFullSlug()when you need the canonical shape unconditionally. -
#
fullPath -
string - Gets the relative path that addresses this record within the site, including the module path and starting with a leading slash. This is the
getFullSlug()value prefixed with the route under which the module is mounted. This is the effective path: when a custom URL is set on the record, it _takes precedence and is returned_ here. Returns an empty string when the record has no custom URL andgetOriginalFullPath()cannot build one, so callers must treat an empty string as "no url" rather than as a path. Rendering it into markup or handing it to a cache or route helper would otherwise point the record at whatever the site serves at its root. -
#
id -
?int -
#
name -
?string -
#
slug -
?string -
#
allowRss -
bool -
#
lockComments -
bool -
#
autoPublishPosts -
bool -
#
autoPublishComments -
bool -
#
requireCommentatorEmail -
bool -
#
tags -
?Collection<Tag> -
#
categories -
?Collection<Category> -
#
posts -
?Collection<Post> -
#
seoSettings -
?SeoSettings -
#
blogAreas -
?Collection<BlogArea> -
#
customUrl -
?CustomUrl - Get the custom url used for the page. This will take precedence over the slugs of this page, parent page and the module.
-
#
externalId -
?string -
#
areasContentAPI & Jobs only -
AreasContent - Fetch content for all layout areas defined for the model as AreasContent object
No members match the filter.
Admin view
AdminAvailable in cdna-admin templates. Copy an admin template into your site repository to change how this record is edited.
Properties 62
Take no arguments.
-
#
getText() -
?string - Get the description for this blog. Also parses image and link placeholders in the process.
-
#
getImageRootTargetFolderPath()Admin only -
string - Retrieves the root target folder path for uploaded images.
-
#
getOriginalFullPath() -
string - Gets the blog's own canonical path within the site, _ignoring_ any custom URL override
-
#
getAreas() -
?Collection -
#
getImageTargetFolderPath()Admin only -
string - Retrieves the target folder path for uploaded images. Images will be moved to this path after the upload has been processed.
-
#
getOriginalPath() -
string - It's an alias and deprecated! Directly use
getOriginalFullPath()instead. -
#
getOriginalFullSlug() -
string - Gets the record's own canonical slug, built from the record's data and _ignoring_ any custom URL override. Like
getFullSlug()it excludes the module path, has no leading slash, and includes ancestor slugs for hierarchical records — but it always reflects the record's real slugs rather than a custom URL. For a non-hierarchical record this equals the record's owngetSlug()value. This default concatenates whatever the ancestor walk supplies and does not judge the segments: an ancestor with no slug of its own contributes an empty segment rather than failing. A model whose callers need to tell an unresolvable chain apart from a valid one should either return an empty string from an override, asProducts\Models\ProductDescriptiondoes, or expose a separate check alongside it, asPages\Models\BasePage::hasResolvableSlugChain()does. -
#
getFullSlug() -
string - Gets the slug that addresses this record relative to its module — the portion of the URL that identifies the record itself, without the module path and without a leading slash. For a hierarchical record the slug includes the slugs of all of its ancestors joined with slashes. This is the effective slug: when a custom URL is set on the record, it _takes precedence and is returned_ here. The no-leading-slash shape describes the canonical value only. A custom URL is returned verbatim, and custom URLs are stored with a leading slash, so a record that has one returns
/my-customrather thanmy-custom; usegetOriginalFullSlug()when you need the canonical shape unconditionally. -
#
getFullPath() -
string - Gets the relative path that addresses this record within the site, including the module path and starting with a leading slash. This is the
getFullSlug()value prefixed with the route under which the module is mounted. This is the effective path: when a custom URL is set on the record, it _takes precedence and is returned_ here. Returns an empty string when the record has no custom URL andgetOriginalFullPath()cannot build one, so callers must treat an empty string as "no url" rather than as a path. Rendering it into markup or handing it to a cache or route helper would otherwise point the record at whatever the site serves at its root. -
#
getId() -
?int -
#
getName() -
?string -
#
getSlug() -
?string -
#
getAllowRss() -
bool -
#
getLockComments() -
bool -
#
getAutoPublishPosts() -
bool -
#
getAutoPublishComments() -
bool -
#
getRequireCommentatorEmail() -
bool -
#
getTags() -
?Collection<Tag> -
#
getCategories() -
?Collection<Category> -
#
getPosts() -
?Collection<Post> -
#
getSeoSettings() -
?SeoSettings -
#
getRelatedBlogs() -
?Collection<Blog> -
#
getBlogAreas() -
?Collection<BlogArea> -
#
getCustomUrl() -
?CustomUrl - Get the custom url used for the page. This will take precedence over the slugs of this page, parent page and the module.
-
#
getExternalId() -
?string -
#
isHierarchicalModel()Not in API & Jobs -
bool - Check whether a model is a hierarchical model, i.e. can have children
-
#
getCheckPermissionsUrl()Admin only -
?string - Get the url for checking user permissions for this record.
Methods 29
Take arguments. The API serialises only getters that need none.
-
#
getPostsByCategoryNames(array $names) -
Collection - Gets all posts of the current blog by given category names. It uses 'OR' condition for every passed value.
-
#
getPostsByCategorySlugs(array $slugs) -
Collection - Gets all posts of the current blog by given category slugs. It uses 'OR' condition for every passed value.
-
#
getPostsByTagNames(array $names) -
Collection - Gets all posts of the current blog by given tag names. It uses 'OR' condition for every passed value.
-
#
getPostsByTagSlugs(array $slugs) -
Collection - Gets all posts of the current blog by given tag slugs. It uses 'OR' condition for every passed value.
-
#
getPostsByAuthorNames(array $names) -
Collection - Gets all posts of the current blog by given author display names. It uses 'OR' condition for every passed value.
-
#
getPostsByAuthorSlugs(array $slugs) -
Collection - Gets all posts of the current blog by given author slugs. It uses 'OR' condition for every passed value, and matches a post when any of its credited authors qualifies. Prefer this over filtering a fetched collection in a template:
ModelsCollection::filtered()cannot express an author query, and silently narrows to the first credited author instead. Passing an empty array is a caller error and throws. A list holding only authors that have no slug yet returns an empty collection. -
#
getAreaContentOrDefault(string $areaName) -
?Content - Get the content of the layout area, or the default content if no content exists
-
#
isAreaBlank(string $areaName) -
bool - Check whether the layout area with the specified name has no usable content. Resolves the area's content, falling back to its default, and reports the area as blank when no content exists at all, when the content is one of the framework's Blank objects, or when the content is empty for its category. Blank describes what is stored, not what renders: the answer comes from the stored content and never renders a template. An area can therefore be not blank and still render nothing — a record that was deleted or has no layout, a component or widget whose template outputs nothing, or text whose only content is a placeholder for a deleted image. To decide on the rendered output instead, test the result of getAreaHtml(). Emptiness cannot always be determined — Content::isEmpty() throws a RuntimeException when the content has no input type, or when its category is not one the framework knows how to answer for. Those two cases are reported as not blank, the same answer the Twig
emptytest gives. Any other failure, such as a database error, is not contained and reaches the error handler. -
#
getAreaAttributesContent(string $areaName) -
array - Gets the content of every layout area attribute. If layout area does not have attributes, returns empty array.
-
#
getAreaAttributesDefaultContent(string $areaName) -
array - Gets the default content of every layout area attribute. If layout area does not have attributes, returns empty array.
-
#
getAreaAttributesContentOrDefault(string $areaName) -
array - Gets the content (or the default content if no content exists) of every layout area attribute. If layout area does not have attributes, returns empty array.
-
#
getEntityAreaByLayoutArea(LayoutArea $area) -
?Model - Get the link record between the layout area and content for the designated layout area
-
#
hasAreaWithName(string $areaName) -
bool - Check if an area with the specified name exists for the container
-
#
getAreaType(string $areaName) -
?InputType - Get the input type for the specified layout area. Returns null if the area with the specified name could not be found.
-
#
getAreaCategory(string $areaName) -
?string - Get the category for the specified layout area. Returns null if the area with the specified name could not be found.
-
#
getAreaEditor(string $areaName) -
?string - Get the editor for the specified layout area. Returns null if the area with the specified name could not be found.
-
#
getAreaRecords(string $areaName) -
?Collection - Get the records for the layout area with the specified name
-
#
getAreaWidget(string $areaName) -
?Widget - Get the widget for the layout area with the specified name
-
#
getAreaComponent(string $areaName) -
?Component - Get the component for the layout area with the specified name
-
#
getAreaCollectionElements(string $areaName) -
?Collection - Get the component collection elements for the layout area with the specified name
-
#
getAreaHtml(string $areaName) -
string - Get the rendered HTML for the component area with the specified name. Adds live preview tags, if enabled.
No members match the filter.