Path: csiph.com!usenet.pasdenom.info!news.etla.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Chris Riesbeck Newsgroups: comp.lang.javascript Subject: Re: how to change a mustache script Date: Tue, 25 Nov 2014 12:35:34 -0600 Lines: 24 Message-ID: References: <3d07171d-ca6d-42f1-b682-f951019b361c@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net cUwKPHN12XhDbb1W58W1SAEDrkawy7TPJwS/YZ2JUNGuHeH/Km Cancel-Lock: sha1:3hvGTT75AEmgw/c0Ksz0s9DcZ7M= User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: <3d07171d-ca6d-42f1-b682-f951019b361c@googlegroups.com> Xref: csiph.com comp.lang.javascript:26207 On 11/25/2014 12:10 PM, JRough wrote: > I need to change the mustache code. Basically if a web page is on a certain tab then it adds the class="current" to the
  • . I need it to skip one tab call activity-tab. How would I do this? >
      > {{# each tab}} >
    • >

      {{name}}

      >
    • > {{/each}} > > ---------------------------Something like--------------- > > {{# each tab}} >
    • >

      {{name}}

      >
    • > {{/each}} > > thanks, > Mustache tries to be as logic-less as possible, to keep the HTML uncluttered. The logic should be in the JavaScript that creates the data you feed to Mustache. Change your JavaScript to create a data model that has the desired class for each tab in it, then in the template, just iterate over the tabs and insert the class.