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

  • SEARCH
  • Home
  • 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 9209865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:56:52+00:00 2026-06-18T00:56:52+00:00

While inside a Handlebars each, I want to access a property and apply the

  • 0

While inside a Handlebars each, I want to access a property and apply the value to those items. In this example, I set up a paragraph tag with each of the options array values. I’d like to add the same class to those same paragraphs as part of the process.

JSON:

"newFaucetCrumbsDiv": {
"options": ["Intro","Video Gallery","Help Me Choose", "Recommendations"],
"recommendationsCount": "0",
"class":"newFaucetCrumbText"
    }

TEMPLATE:

<div id="newFaucetCrumbsDiv">
    {{#each newFaucetCrumbsDiv.options}}
        <p class="{{newFaucetCrumbsDiv.class}}">{{this}}</p>
    {{/each}}
</div>

My p tags appear properly but not the class. In the JSON I don’t want to have to call out the class for each of the items in the array – too verbose and they are the same. Is there Handlebars syntax that allows for this? If not, what helper might help? Thank you, I’m just getting off the ground with Handlebars~!

  • 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-18T00:56:53+00:00Added an answer on June 18, 2026 at 12:56 am

    You have to use ../ to back out into the parent context:

    <div id="newFaucetCrumbsDiv">
        {{#each newFaucetCrumbsDiv.options}}
            <p class="{{../newFaucetCrumbsDiv.class}}">{{this}}</p>
        {{/each}}
    </div>
    

    Here’s a quote from the docs:

    Nested handlebars paths can also include ../ segments, which evaluate their paths against a parent context… The ../ path segment references the parent template scope, not one level up in the context…

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

Sidebar

Related Questions

While reading this class BitmapFactory I noticed that almost all methods inside are static.
Is it possible to get template name while inside template? Example: <xsl:template name=list> <!--
I want to prepend IP header on an existing IP packet while inside NF_HOOK_LOCAL_OUT.
I am trying to bind to a property while inside a XAML 'property setter'.
I've got this issue. A template called checkbox that's called from while inside a
I'm trying to read the value of an observable while inside it's subscribe method
If a thread is interrupted while inside Object.wait() or Thread.join() , it throws an
I made a while loop inside a program and the program reaches the while
I have some problems with controlling a while loop inside an event structure. Say
I have a small file test.txt contains a Long number inside while another piece

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.