Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9168787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:42:38+00:00 2026-06-17T15:42:38+00:00

I am using ember, primarily for the convenience of client-side templating. I am having

  • 0

I am using ember, primarily for the convenience of client-side templating.

I am having trouble when I have multiple <script type="text/x-handlebars"> tags in a page. It only ends up displaying the last template. So if I start with

<script type="text/x-handlebars">
    <h1> My name is {{name}} </h1> 
    <h2> My favorite color is {{color}} </h2>
</script>

It displays the full message. But if I turn it into

<script type="text/x-handlebars">
    <h1> My name is {{name}} </h1> 
</script>
<p> This is some static content </p>
<script type="text/x-handlebars">
    <h2> My favorite color is {{color}} </h2>
</script>

It only displays the favorite color line.

I’m trying to copy similar behavior in the example http://emberjs.com/examples/contacts/ , but they don’t seem to have a problem with multiple unnamed scripts executing.

Anyone know what I need to do to make this work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:42:40+00:00Added an answer on June 17, 2026 at 3:42 pm

    Those examples are very out of date. If you are trying to follow along with them using latest version of ember many things will not work.

    Specific to your question, ember will use the last un-named template as your application template but you’ll need to name the others. So for the above example add a data-template-name attribute:

    <script type="text/x-handlebars" data-template-name="color">
      <h2> My favorite color is {{color}} </h2>
    </script>
    

    With this in place, ember will use the remaining template as the ‘application’ template. Now you will need to modify that template to insert the “color” template in the appropriate place. There are many ways to accomplish this – here I am using the partial helper:

    <script type="text/x-handlebars">
      <h1> My name is {{name}} </h1> 
      {{partial "color"}}
    </script>
    

    Here is a working example: http://jsbin.com/uzeyum/2/edit

    Hope this helps you get started. Since the examples are so out of date I recommend you instead read through the ember guides! which are up-to-date with the latest release.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using: ember: v1.0.0-pre.4 ember-data: revision 11 handlebars: 1.0.rc2 So I have a template that
I'm using Ember 0.9.8.1 and having an issue with nested views not retaining the
So I started using EmberJS today. // js/main.js require.config({ baseUrl:'js/', paths:{ ember: 'libs/emberjs/ember-0.9.8.1', text:
I'm using Ember.js with handlebars and I need to make a div within my
I'm loading App.Structure objects using ember-data's fixtures adapter. These objects have embedded App.Overlay objects
I'm using ember 1.0 pre and have a basic array controller that starts out
I have been using Ember's Router (v1.0.pre) with single dynamic segments and really happy
Explanation: I'm using ember-data for a project of mine and I have a question
I have just started using Ember.js framework and I have simple problem. I have
I'm using Ember.js and I'm trying to have a div element with two different

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.