Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support dots in names of templates. #38

Closed
laosb opened this issue May 10, 2016 · 11 comments
Closed

Support dots in names of templates. #38

laosb opened this issue May 10, 2016 · 11 comments

Comments

@laosb
Copy link

laosb commented May 10, 2016

Originally posted on meteor/meteor#5584 by @matteodem

Create an empty meteor app (version 1.2.1) and paste in following html:

<body>
  {{> myNamespace.testTemplate}}
</body>

<template name="myNamespace.testTemplate">
  Hello
</template>

Which does not work, whereas the same template without the . in its name works.

@matteodem
Copy link
Contributor

Still would be awesome to have, if there are some guidelines I'd be happy to create a pull request for it.

@mitar
Copy link
Contributor

mitar commented May 10, 2016

Please upvote the issue and don't comment for upvote.

@matteodem
Copy link
Contributor

If you're referencing my comment then that's not accurate, as I'm also communicating that

if there are some guidelines I'd be happy to create a pull request for it

with guidelines I mean actual references in the source code to show where the crucial parts are to make this happen.

@mitar
Copy link
Contributor

mitar commented May 11, 2016

If you're referencing my comment then that's not accurate, as I'm also communicating that

No, it was one other comment before, which has been in meantime deleted by the author and converted to an upvote above. Sorry for confusion.

with guidelines I mean actual references in the source code to show where the crucial parts are to make this happen.

For that, this has been implemented in Blaze Components, you can check there. I wrote a short guide for how this could be added to Blaze here. Blaze Components do it in a bit different way with exact namespaces (so namespace is a different thing than a template/component, so that you can have both a.b and a.b.c templates, where a.b.c is a template inside a a.b namespace, which is different from a.b. template), I do not think we should be complicating for Blaze this.

@mitar
Copy link
Contributor

mitar commented May 11, 2016

But one thing. This particular feature is something I think would be more suitable for Blaze 2 release. So what I imagine for current Blaze (1) is to just fix bugs and keep it as it is more or less. For Blaze 2 we should probably then reiterate on few things (like what is this and so on, and break backwards compatibility, and then we could also break this question of names for templates).

@matteodem
Copy link
Contributor

Also makes sense to me, might confusing for people though that EasySearch has . in templates. But until more general questions are not answered I'd leave it as is too.

@humbertocruz
Copy link

{{> Template.dynamic template='dot.named.template'}} works for me

@mitar
Copy link
Contributor

mitar commented Jan 6, 2017

Should we make this be {{> "myNamespace.testTemplate"}}? Because I think in fact this is not the best design that constants can be provided without quotes in Spacebars. To me {{> myNamespace.testTemplate}} should be more like JavaScript, where myNamespace is local helper, and then testTemplate its property.

Does {{> "myNamespace.testTemplate"}} maybe already work?

@matteodem
Copy link
Contributor

I'm not sure if it works with quotes, but would be okay for me.

Should the dotted notation already work? As in if myNamespace would be an object in your example with testTemplate the template.

@mitar
Copy link
Contributor

mitar commented Jan 9, 2017

I have no idea if it works. I think it is a bit trickier anyway. Because we should decide if nested helpers mean that you have an object with templates, or do you have a template with name which contains a dot. So is myNamespace.testTemplate or Template['myNamespace.testTemplate'] to which it should resolve.

@filipenevola
Copy link
Collaborator

I'm closing this issue because it's too old.

If you think this issue is still relevant please open a new one.

Why? We need to pay attention to all the open items so we should keep opened only items where people are involved.

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

No branches or pull requests

5 participants