View Source Elph.Contents.Types (elph v0.9.1)

In this file the macros regarding custom types are defined.

To use custom types this module has to be used. Add elph_types() to use the default elph content types.

For each type add type(:markdown, <YourApp>.<YourContext>.Markdown, <YourAppWeb>.MarkdownView) with the following params

  • The name of your type
  • Your content module <YourApp>.<YourContext>.MarkdownContent
  • The view which will be called to render the result.
    • It needs a def render("markdown.json", %{content: content}) do function.
    • Care! Use <name>.json as first param.
    • Alternatively you can use nil if you dont need to render any type-specific fields

The useing file also has to be added to your config, to activate your custom types: config :elph, types: <YourApp>.Contents.Types

Link to this section Summary

Link to this section Functions