Closed PastorBones closed 12 years ago
Good point. Helpers don't work yet in Blade. Thanks for pointing out this issue. This will be addressed shortly.
Actually... on second thought... why would that show up as a bundle error? Is your info.blade
template included in your body.blade
template? Do you even have a body.blade
template? If so, could you post it here?
Here's pretty much everything besides the Meteor.method that gathers data from the server (through an additional api call of a external MMO). The Session variables are being set properly within that method call...
client.js
{project}/client/client.js
if( Meteor.is_client) {
// Session('data') is being set in a Module.call
Template.info.alliance = function(){
var data = Session.get( 'data' );
return data.alliance;
};
Template.info.player = function(){
var data = Session.get( 'data' );
return data.player;
};
}
Templates
{project}/views/body.blade
body
.navbar.navbar-inverse.navbar-fixed-top
.navbar-inner
.container-fluid
.brand MySite
.container-fluid
.row-fluid
.span3
include 'sidebar'
{project}/views/sidebar.blade
#sidebar.well.sidebar-nav
include 'info'
{project}/views/info.blade
.player-name.large= player.name
.alliance-name= alliance.name
.world-name= world.name
body.blade
templates.Helpers do not work in body.blade
templates. If your body.blade
file includes another file that uses helpers, it will also not work.
This is by design. body.blade
files are for rendering initial static page content only. Handlebars uses another approach, which allows for dynamic content; however, I believe that it's a bit confusing, since Handlebars does not allow for dynamic content in <head>
tags.
Thoughts on this?
See this wiki page for more information.
I've asked the following question previously on SO: http://stackoverflow.com/questions/13438793/meteor-blade-included-templates-still-use-the-context-of-the-parent
Could it be that it is related to this?
@VanCoding - probably not. The link you posted above is a separate bug. :-/
I've got blade working with Meteor and it's rendering static html fine. However, I'm getting a bundle error when trying to use template variables.
Client.js
info.blade
Error