Skip to content
This repository was archived by the owner on Sep 6, 2022. It is now read-only.

Include dynamic template inside content block? #197

Open
markudevelop opened this issue Jan 18, 2016 · 0 comments
Open

Include dynamic template inside content block? #197

markudevelop opened this issue Jan 18, 2016 · 0 comments

Comments

@markudevelop
Copy link

I'm new to jade so sorry if this obvious but I've looked into issues/docs and It seems like "components" block in jade just supports text?

https://github.com/mquandalle/meteor-jade/blob/master/examples/components.jade
it works for text but if I want this template in jade how to do that? I'm intersted in {#onlyIfLoggedIn}} part to include dynamic template if it evaluates to true

<template name="layout">
  {{#if Template.subscriptionsReady}}
    {{#onlyIfLoggedIn}}
      <div class="container main">
        {{> Template.dynamic template=main}}
      </div>
    {{/onlyIfLoggedIn}}
  {{/if}}
</template>

<template name="onlyIfLoggedIn">
  {{#if authInProcess}}
    <!--<p>loading ...</p>-->
  {{else}}
    {{#if canShow}}
      {{> UI.contentBlock }}
    {{/if}}
  {{/if}}
</template>

here is one of the option that I've tried

template(name="layout")
  +onlyIfLoggedIn
    | +Template.dynamic(template=main)



template(name="onlyIfLoggedIn")
  if authInProcess
    // <p>loading...</p>
  else
    if canShow
      +UI.contentBlock

Thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant