Imagine.CmsTemplates (imagine_cms v6.3.5)

The CmsTemplates context.

Link to this section Summary

Functions

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

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

Creates a cms_snippet.

Creates a cms_snippet_version.

Creates a cms_template.

Creates a cms_template_version.

Deletes a CmsSnippet.

Deletes a CmsTemplate.

Gets a single cms_snippet.

Gets a single cms_snippet_version.

Gets a single cms_template.

Gets a single cms_template_version.

Returns the list of cms_snippet_versions.

Returns the list of cms_snippets.

Returns the list of cms_template_versions.

Returns the list of cms_templates.

Link to this section Functions

Link to this function

change_cms_snippet(cms_snippet)

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

Examples

iex> change_cms_snippet(cms_snippet)
%Ecto.Changeset{source: %CmsSnippet{}}
Link to this function

change_cms_template(cms_template)

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

Examples

iex> change_cms_template(cms_template)
%Ecto.Changeset{source: %CmsTemplate{}}
Link to this function

create_cms_snippet(attrs)

Creates a cms_snippet.

Examples

iex> create_cms_snippet(%{field: value})
{:ok, %CmsSnippet{}}

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

create_cms_snippet_version(cms_snippet)

Creates a cms_snippet_version.

Examples

iex> create_cms_snippet_version(%{field: value})
{:ok, %CmsSnippetVersion{}}

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

create_cms_template(attrs)

Creates a cms_template.

Examples

iex> create_cms_template(%{field: value})
{:ok, %CmsTemplate{}}

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

create_cms_template_version(cms_template)

Creates a cms_template_version.

Examples

iex> create_cms_template_version(%{field: value})
{:ok, %CmsTemplateVersion{}}

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

delete_cms_snippet(cms_snippet)

Deletes a CmsSnippet.

Examples

iex> delete_cms_snippet(cms_snippet)
{:ok, %CmsSnippet{}}

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

delete_cms_template(cms_template)

Deletes a CmsTemplate.

Examples

iex> delete_cms_template(cms_template)
{:ok, %CmsTemplate{}}

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

get_cms_snippet!(id)

Gets a single cms_snippet.

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

Examples

iex> get_cms_snippet!(123)
%CmsSnippet{}

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

get_cms_snippet_by_name(name)

Link to this function

get_cms_snippet_version!(id)

Gets a single cms_snippet_version.

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

Examples

iex> get_cms_snippet_version!(123)
%CmsSnippetVersion{}

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

get_cms_template!(id)

Gets a single cms_template.

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

Examples

iex> get_cms_template!(123)
%CmsTemplate{}

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

get_cms_template_by(params)

Link to this function

get_cms_template_version!(id)

Gets a single cms_template_version.

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

Examples

iex> get_cms_template_version!(123)
%CmsTemplateVersion{}

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

get_cms_template_version_by(params)

Link to this function

list_cms_snippet_versions()

Returns the list of cms_snippet_versions.

Examples

iex> list_cms_snippet_versions()
[%CmsSnippetVersion{}, ...]
Link to this function

list_cms_snippets()

Returns the list of cms_snippets.

Examples

iex> list_cms_snippets()
[%CmsSnippet{}, ...]
Link to this function

list_cms_template_versions()

Returns the list of cms_template_versions.

Examples

iex> list_cms_template_versions()
[%CmsSnippetVersion{}, ...]
Link to this function

list_cms_templates()

Returns the list of cms_templates.

Examples

iex> list_cms_templates()
[%CmsTemplate{}, ...]
Link to this function

update_cms_snippet(cms_snippet, attrs)

Updates a cms_snippet.

Examples

iex> update_cms_snippet(cms_snippet, %{field: new_value})
{:ok, %CmsSnippet{}}

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

update_cms_template(cms_template, attrs)

Updates a cms_template.

Examples

iex> update_cms_template(cms_template, %{field: new_value})
{:ok, %CmsTemplate{}}

iex> update_cms_template(cms_template, %{field: bad_value})
{:error, %Ecto.Changeset{}}