Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add better comments to template module #45

Open
adrinux opened this Issue · 6 comments

3 participants

@adrinux

So. If the example 'template' module has:

/**
 * Every page block function
 */
function allPages(req, res, template, block, next) {

  var myVariable = "Hello World on every page!";
  var item = {
    id: "NA",
    type: 'content',
    meta: {
      variable: myVariable
    }
  };

  calipso.theme.renderItem(req, res, template, block, {
    item: item
  },next);

};

Why doesn't a block with "Hello World on every page!" appear on every page?
I started work on an admin toolbar module, https://github.com/adrinux/calipso/tree/module-toolbar but can't fathom why a block isn't appearing, despite looking at core/community modules.

@cliftonc
Owner

The module needs to be turned on, and the block needs to be rendered in a template within the theme. If you look in the init function, you will see that by default that function renders to a block called 'right', so this needs to be included in the right.js / right.html in the theme (the name is just a key, you have to include it for it to appear).

You will see that for most things, the block is something like content.blah - and the theme typically uses a regex to render anything /content.*/ to the body element of a page. The template module isn't actually a great example any more, specifically with cleanslate as it doesn't include it by default ... needs to be fixed!

HTH

Clifton

@cliftonc
Owner

Also - note on the other issue, is that it definitely shouldn't be called right! :)

@dennishall
Collaborator

On the other hand, including too many things in cleanslate would turn it into a misnomer.

I think that the 'template' module just needs beefier comments. A good place to start might be to paste your comment in this thread at the top of the template module.

@dennishall
Collaborator

@adrinux / cliftonc - comment & close [this thread]?

@adrinux

A more descriptive title - haven't had time to get back to this issue yet.

@cliftonc
Owner

Will target a full breadth example / template module for the 0.3.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.