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
backups(page_slug)
Retrieves all backups for a given slug. Returns the backup.
backups(slug)
Callback implementation for Thesis.Store.backups/1
.
delete(map)
Deletes a given page by slug.
file(slug)
Retrieves a file by slug.
page(slug)
Returns a Thesis.Page struct with the given slug (aka request_path).
Callback implementation for Thesis.Store.page/1
.
page_content(page_id, name)
Retrieves a single %PageContent{} (or nil, if it doesn't exist) based on page_id and name.
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.
page_contents(slug)
Handles `%Page{...}`` struct - means page has been edited and saved. Retrieves page content and global content.
restore(id)
Retrieves a given backup (identified by its id). Returns the backup.
restore(backup_id)
Callback implementation for Thesis.Store.restore/1
.
update(page_params, contents_params)
Updates a page and its page_contents and global content areas.