Imagine.CmsPages (imagine_cms v6.3.5)

The CmsPages context.

Link to this section Summary

Functions

Returns an %Ecto.Changeset{} for tracking cms_page changes.

Returns an %Ecto.Changeset{} for tracking cms_page_tag changes.

Creates a cms_page_tag.

Creates a cms_page_version.

Deletes a CmsPage.

Deletes a CmsPageTag.

Gets a single cms_page.

Gets a single cms_page_object.

Gets a single cms_page_tag.

Gets a single cms_page_version.

Returns the list of cms_page_objects.

Returns the list of cms_page_tags.

Returns the list of cms_page_versions.

Updates a cms_page, optionally creating a new version (third argument). When creating a new version, the fourth argument should be the Imagine.Accounts.User who made the change.

Link to this section Functions

Link to this function

active_pages_query()

Link to this function

active_versions_query()

Link to this function

build_cms_page_object(arg1, obj_name, obj_type)

Link to this function

build_cms_page_object(cms_page_id, cms_page_version, obj_name, obj_type)

Link to this function

change_cms_page(cms_page)

Returns an %Ecto.Changeset{} for tracking cms_page changes.

Examples

iex> change_cms_page(cms_page)
%Ecto.Changeset{source: %CmsPage{}}
Link to this function

change_cms_page_tag(cms_page_tag)

Returns an %Ecto.Changeset{} for tracking cms_page_tag changes.

Examples

iex> change_cms_page_tag(cms_page_tag)
%Ecto.Changeset{source: %CmsPageTag{}}
Link to this function

clone_and_update_cms_page_object(cms_page_object, attrs)

Link to this function

create_cms_page(attrs, current_user, iteration \\ 0)

Creates a cms_page.

Examples

iex> create_cms_page(%{field: value})
{:ok, %CmsPage{}}

iex> create_cms_page(%{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function

create_cms_page_object(cms_page, attrs \\ %{})

Creates a cms_page_object.

Examples

iex> create_cms_page_object(%{field: value})
{:ok, %CmsPageObject{}}

iex> create_cms_page_object(%{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function

create_cms_page_tag(attrs)

Creates a cms_page_tag.

Examples

iex> create_cms_page_tag(%{field: value})
{:ok, %CmsPageTag{}}

iex> create_cms_page_tag(%{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function

create_cms_page_version(cms_page)

Creates a cms_page_version.

Examples

iex> create_cms_page_version(%{field: value})
{:ok, %CmsPageVersion{}}

iex> create_cms_page_version(%{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function

delete_cms_page(cms_page)

Deletes a CmsPage.

Examples

iex> delete_cms_page(cms_page)
{:ok, %CmsPage{}}

iex> delete_cms_page(cms_page)
{:error, %Ecto.Changeset{}}
Link to this function

delete_cms_page_tag(cms_page_tag)

Deletes a CmsPageTag.

Examples

iex> delete_cms_page_tag(cms_page_tag)
{:ok, %CmsPageTag{}}

iex> delete_cms_page_tag(cms_page_tag)
{:error, %Ecto.Changeset{}}
Link to this function

delete_cms_page_version(cms_page_version)

Link to this function

destroy_cms_page(cms_page)

Link to this function

discarded_pages_query()

Link to this function

get_cms_page(id)

Link to this function

get_cms_page(id, list)

Link to this function

get_cms_page!(id)

Gets a single cms_page.

Raises Ecto.NoResultsError if the Cms page does not exist.

Examples

iex> get_cms_page!(123)
%CmsPage{}

iex> get_cms_page!(456)
** (Ecto.NoResultsError)
Link to this function

get_cms_page!(id, opts)

Link to this function

get_cms_page_by_path(path)

Link to this function

get_cms_page_by_path_for_nav(path)

Link to this function

get_cms_page_by_path_with_objects(path, version \\ nil)

Link to this function

get_cms_page_object!(id)

Gets a single cms_page_object.

Raises Ecto.NoResultsError if the Cms page object does not exist.

Examples

iex> get_cms_page_object!(123)
%CmsPageObject{}

iex> get_cms_page_object!(456)
** (Ecto.NoResultsError)
Link to this function

get_cms_page_tag!(id)

Gets a single cms_page_tag.

Raises Ecto.NoResultsError if the Cms page tag does not exist.

Examples

iex> get_cms_page_tag!(123)
%CmsPageTag{}

iex> get_cms_page_tag!(456)
** (Ecto.NoResultsError)
Link to this function

get_cms_page_version!(id)

Gets a single cms_page_version.

Raises Ecto.NoResultsError if the Cms page version does not exist.

Examples

iex> get_cms_page_version!(123)
%CmsPageVersion{}

iex> get_cms_page_version!(456)
** (Ecto.NoResultsError)
Link to this function

get_cms_page_version_by(params)

Link to this function

get_cms_page_version_by(cms_page, params)

Link to this function

get_cms_page_with_objects!(id, version \\ nil)

Link to this function

get_home_page!()

Link to this function

get_home_page_version_by(params)

Link to this function

get_trash_page()

Link to this function

list_cms_page_objects()

Returns the list of cms_page_objects.

Examples

iex> list_cms_page_objects()
[%CmsPageObject{}, ...]
Link to this function

list_cms_page_tags()

Returns the list of cms_page_tags.

Examples

iex> list_cms_page_tags()
[%CmsPageTag{}, ...]
Link to this function

list_cms_page_versions()

Returns the list of cms_page_versions.

Examples

iex> list_cms_page_versions()
[%CmsPageVersion{}, ...]
Link to this function

list_cms_pages(order_by \\ [asc: :path], limit \\ 1000)

Returns the list of cms_pages.

Examples

iex> list_cms_pages()
[%CmsPage{}, ...]
Link to this function

list_discarded_cms_pages()

Link to this function

list_recent_cms_pages(limit \\ 10)

Link to this function

preload_objects_and_versions(page_or_version)

Link to this function

undelete_cms_page(cms_page)

Link to this function

update_cms_page(cms_page, attrs, save_new_version \\ false, current_user \\ nil)

Updates a cms_page, optionally creating a new version (third argument). When creating a new version, the fourth argument should be the Imagine.Accounts.User who made the change.

Examples

iex> update_cms_page(cms_page, %{field: new_value})
{:ok, %CmsPage{}}

iex> update_cms_page(cms_page, %{field: bad_value}, true, current_user)
{:error, %Ecto.Changeset{}}
Link to this function

update_cms_page_object(cms_page_object, attrs)

Updates a cms_page_object.

Examples

iex> update_cms_page_object(cms_page_object, %{field: new_value})
{:ok, %CmsPageObject{}}

iex> update_cms_page_object(cms_page_object, %{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function

update_cms_page_objects(list1, list2, new_version)

Link to this function

update_cms_page_tag(cms_page_tag, attrs)

Updates a cms_page_tag.

Examples

iex> update_cms_page_tag(cms_page_tag, %{field: new_value})
{:ok, %CmsPageTag{}}

iex> update_cms_page_tag(cms_page_tag, %{field: bad_value})
{:error, %Ecto.Changeset{}}