Return two different arrays with helper, use in one each helper?


#1

I have a block helper like this:

		{{vendor_images.downloadurl}}
		{{#each vendors}}
		<div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
			<iron-image sizing="cover" preload fade src="{{vendor_images.downloadurl}}"></iron-image>
			<paper-item>
				<paper-item-body two-line>
					<div>{{this.profile.cityShort}}</div>
					<div secondary>Standard, finishes</div>
				</paper-item-body>
				63 <paper-icon-button icon="pigments:star"></paper-icon-button>		
			</paper-item>

		</div>
		{{/each}}

The helper vendor_images is a seperate collection from the user collection that i’m returning. I want to output every user with vendors and in that helper I want to output the images that are in vendor_images. Like this it doesn’t work though. Can I reference to another helper within another block helper in my template?

If this is not possible I thought maybe I can do something like return both things in one helper like vendors_all does. Am I on the right track here? If so, how can I differentiate? How can I do this?

  vendors: function() {
      return Meteor.users.find( );
      //return Visitors.find({ userid: index_clicked });
  },

  vendor_images: function() {
  	var vendor_images = VendorProfileImages.findOne({ userid: Meteor.userId() }, {sort: { index: 1 }} );
	return vendor_images;
  },

  vendors_all: function() {
  	var vendor_images = VendorProfileImages.findOne({ userid: Meteor.userId() }, {sort: { index: 1 }} );
	return 
	[
		vendor_images,
	    Meteor.users.find()
	];
  },

#2

You can define global helpers, which are not tied to any particular template.