Generates everything to manage pages built with the visual editor: migration, schema, context, an admin list, the editor page and the public page.
$ mix elementorex.gen.cms Pages Page pages
The three arguments are the context, the schema and the table, like
mix phx.gen.live. It creates:
priv/repo/migrations/*_create_pages.exs-title, uniqueslug,body(the document,jsonb),statusandpublished_atlib/my_app/pages/page.exandlib/my_app/pages.exlib/my_app_web/live/page_live/index.ex(+.html.heex) - list and creation, for your adminlib/my_app_web/live/page_live/editor.ex(+.html.heex) - the editor, with save and publishlib/my_app_web/live/page_live/show.ex(+.html.heex) - the public page at/p/:slug(only published pages)
Then add the routes it prints (the admin ones inside your authenticated admin
live_session) and run the migration.
Options
--binary-id- use UUID primary keys (default: your app's:generatorsconfig)--public-path- public prefix (default/p)--admin-path- admin prefix (default/admin/<table>)--force- overwrite existing files