thesis v0.3.4 Thesis.EctoStore

Thesis.EctoStore is the most commonly-used store for Thesis pages and content. It interfaces with the host application's repo (which is provided in the config.exs of the host applicaton).

You can generally just use Thesis.EctoStore unless you're not using Ecto in your project or you want to do something custom with how Thesis is handling its data.

Link to this section Summary

Functions

Retrieves all backups for a given slug. Returns the backup

Deletes a given page by slug

Retrieves a file by slug

Returns a Thesis.Page struct with the given slug (aka request_path)

Retrieves a single %PageContent{} (or nil, if it doesn't exist) based on page_id and name

Returns an existing %PageContent{} record or a newly created one with the provided page_id and name set

Handles `%Page{...}`` struct - means page has been edited and saved. Retrieves page content and global content

Retrieves a given backup (identified by its id). Returns the backup

Updates a page and its page_contents and global content areas

Link to this section Functions

Link to this function

backups(page_slug)

Retrieves all backups for a given slug. Returns the backup.

backups(slug)

Callback implementation for Thesis.Store.backups/1.

Deletes a given page by slug.

Retrieves a file by slug.

Returns a Thesis.Page struct with the given slug (aka request_path).

Callback implementation for Thesis.Store.page/1.

Link to this function

page_content(page_id, name)

Retrieves a single %PageContent{} (or nil, if it doesn't exist) based on page_id and name.

Link to this function

page_content_or_new(page_id, name, preloaded_contents)

Returns an existing %PageContent{} record or a newly created one with the provided page_id and name set.

Link to this function

page_contents(slug)

Handles `%Page{...}`` struct - means page has been edited and saved. Retrieves page content and global content.

Retrieves a given backup (identified by its id). Returns the backup.

restore(backup_id)

Callback implementation for Thesis.Store.restore/1.

Link to this function

update(page_params, contents_params)

Updates a page and its page_contents and global content areas.