Coder Social home page Coder Social logo

Making regions more usable. about blaze-layout HOT 5 OPEN

cmather avatar cmather commented on May 18, 2024
Making regions more usable.

from blaze-layout.

Comments (5)

tmeasday avatar tmeasday commented on May 18, 2024

I went ahead and did this an added {{> yield region='foo' text='true'}} to deal with differentiating between setting templates and setting text. Let's discuss soon :)

from blaze-layout.

cmather avatar cmather commented on May 18, 2024

Hey @tmeasday! Sorry for the delay. I'm trying to understand the idea but not sure I'm getting it. So, in the first example, are you trying to set the content for the 'title' region by passing its value as an argument to Layout? Where does title's value from from? Is it dynamic? Why go through the trouble of creating a yield region in this case vs. just putting some dynamic content in the layout. What am I missing :)?

from blaze-layout.

tmeasday avatar tmeasday commented on May 18, 2024

Hey @cmather. I'll try to be clearer about the base use case and then perhaps my comments above will make more sense.

We're using layouts to wrap the contents of a template in standard boilerplate. As an example, the title of the page is included in the boilerplate. For some pages, the title is fixed -- for others it's dynamic. I was talking about a case where the title is dynamic, and thus a helper on the outer template (Template.somePage.title above).

With the current API, we could just do:

<template name="somePage">
  {{#Layout template='pageLayout}}
    {{#contentFor region='title'}}{{title}}{{/contentFor}}
   {{/Layout}}
</template>

But I'm looking for a way to set the content or template (both are important) for a region more directly when calling {{#Layout.

from blaze-layout.

tmeasday avatar tmeasday commented on May 18, 2024

I realise you probably haven't had time to think about this, but when you can circle back round I have a quick qn in regards to this:

If I render a layout with helper argument (like {{#Layout regionX=helper}}), how does the component receive notice when helper changes?

It doesn't seem like this.get('regionX') is what I'm looking for here - it doesn't seem to be reactive and change when helper changes. But this must work somehow... or is this a limitation of blaze?

from blaze-layout.

cmather avatar cmather commented on May 18, 2024

Might be a limitation if I recall. I Need to check though.

On Apr 24, 2014, at 11:33 PM, Tom Coleman [email protected] wrote:

I realise you probably haven't had time to think about this, but when you can circle back round I have a quick qn in regards to this:

If I render a layout with helper argument (like {{#Layout regionX=helper}}), how does the component receive notice when helper changes?

It doesn't seem like this.get('regionX') is what I'm looking for here - it doesn't seem to be reactive and change when helper changes. But this must work somehow... or is this a limitation of blaze?


Reply to this email directly or view it on GitHub.

from blaze-layout.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.