Skip to content

How to create a page

jifeon edited this page Mar 18, 2015 · 3 revisions

There is an yeoman generator for that.

But under the hood:

  1. Create a page block directory. Block name must be prefixed with page-:
$ mkdir desktop.blocks/page-hello-world
  1. Create page-hello-world.deps.js file.
$ touch desktop.blocks/page-hello-world/page-hello-world.deps.js
You'll need to add a dependency from `i-page` at least.
({
    mustDeps: ['i-page'],
    shouldDeps: [{elem: 'title'}]
})
  1. Create page-hello-world.bemtree file - data-template of your page.
block('page-hello-world').content()('Hello, world!');

block('page-hello-world').elem('title').content()('hello-world page');
  1. Add your page's route to desktop.bundles/index/index.routing.yml.
- id: page-hello-world
  path: /hello-world
  1. Add your page's block to desktop.bundles/index/index.bemdecl.js.
Clone this wiki locally