The only way to transfer data to your templates is through helpers. You can use the global helper :
Template.registerHelper('imgExampleUrl', function() { return 'img.example.com'; });
Then you can use the global helper in many templates:
<template name="products"> {{#each items}} <img src="http://{{imgExampleUrl}}/{{id}}.png"> {{/each}} </template> <template name="otherTemplate"> <img src="http://{{imgExampleUrl}}/{{id}}.png"> </template>
Or, if you want to get the value of imgExampleUrl from settings.json
Template.registerHelper('imgExampleUrl', function() { return Meteor.settings.public.imgExampleUrl; });
Your .json settings:
{ "public": { "imgExampleUrl": "img.example.com" } }
source share