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 #5584

Closed
matteodem opened this issue Nov 1, 2015 · 13 comments
Closed

Support dots in names of templates #5584

matteodem opened this issue Nov 1, 2015 · 13 comments

Comments

@matteodem
Copy link
Contributor

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.

@stubailo stubailo changed the title Templates with dots in them are not rendered validly Support dots in names of templates Nov 2, 2015
@stubailo stubailo self-assigned this Nov 2, 2015
@stubailo
Copy link
Contributor

stubailo commented Nov 2, 2015

Great idea, I think we should definitely make this work.

@matteodem
Copy link
Contributor Author

This is not a feature. It clearly worked before as the easysearch docs show http://matteodem.github.io/meteor-easy-search/docs/components/.

This is a bug to me that was created in the latest version. (I just realize that I didn't write it clearly enough in the issue description itself, I hope it makes more sense now.)

@stubailo
Copy link
Contributor

stubailo commented Nov 2, 2015

created in the latest version

You could have dots in template names in 1.2?

@matteodem
Copy link
Contributor Author

Yes, see the link to the docs that I attached, it worked previously. This problem occured only in the latest version 1.2.1.

@stubailo
Copy link
Contributor

stubailo commented Nov 2, 2015

Weird, it doesn't seem consistent with the changelog. Going to try a test app now.

@stubailo
Copy link
Contributor

stubailo commented Nov 2, 2015

I can't get {{> hello.world}} to work. In my repro, it compiles to return Spacebars.call(Spacebars.dot(view.lookup("hello"), "world"));, which doesn't correctly render the template. Can you give me an example of a project that runs with Meteor 1.2.0.2 where there is a dot in the template name and it can be included using Spacebars?

@matteodem
Copy link
Contributor Author

hm it might be that it works with EasySearch because of me using blaze components, but that doesn't sound like it would make a lot of sense. @mitar any ideas?

The easysearch leaderboard is a good example:https://github.com/matteodem/easy-search-leaderboard/blob/master/leaderboard.html#L17

@stubailo
Copy link
Contributor

stubailo commented Nov 2, 2015

Actually, that's exactly it. @mitar does some hacks to make dotted template names work properly in Blaze components. But I think we should move those hacks into core to make it work everywhere.

@matteodem
Copy link
Contributor Author

Yes, if mitar can give me some hints on how these hacks are implemented I might give it a shot.

@stubailo
Copy link
Contributor

stubailo commented Nov 2, 2015

We also want this for the Meteor guide, since we want to suggest namespacing templates with dots: meteor/guide#46

@mitar
Copy link
Contributor

mitar commented Nov 3, 2015

Yes, @matteodem, see discussion in meteor/guide#46 for some direction where this stuff should be.

BTW, I think this should be exposed as Template['myNamespace.testTemplate'] in JavaScript, in my opinion. So that you can have both Template.base and Template.base.item as templates.

@mitar
Copy link
Contributor

mitar commented Nov 3, 2015

Also, I think we should do this peerlibrary/meteor-blaze-components#21.

@laosb
Copy link
Contributor

laosb commented May 10, 2016

Moved to meteor/blaze#38.

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

No branches or pull requests

5 participants