Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Using a for loop's current index as an argument in a tag

Received: by 10.143.84.8 with SMTP id m8mr577323wfl.44.1277174451190;
        Mon, 21 Jun 2010 19:40:51 -0700 (PDT)
X-BeenThere: liquid-templates@googlegroups.com
Received: by 10.142.248.9 with SMTP id v9ls2997441wfh.1.p; Mon, 21 Jun 2010 
	19:40:49 -0700 (PDT)
Received: by 10.143.46.3 with SMTP id y3mr575735wfj.26.1277174449807;
        Mon, 21 Jun 2010 19:40:49 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.150.173.18 with SMTP id v18mr489565ybe.65.1277170018333; Mon, 
	21 Jun 2010 18:26:58 -0700 (PDT)
Received: by s6g2000prg.googlegroups.com with HTTP; Mon, 21 Jun 2010 18:26:58 
	-0700 (PDT)
Date: Mon, 21 Jun 2010 18:26:58 -0700 (PDT)
X-IP: 70.36.146.60
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) 
	AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.70 Safari/533.4,gzip(gfe)
Message-ID: <c0bfbf04-3551-4498-bf93-99ad608bb49d@s6g2000prg.googlegroups.com>
Subject: Using a for loop's current index as an argument in a tag
From: Tom Preston-Werner <mojo...@gmail.com>
To: Liquid Templates <liquid-templates@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1

Is it possible to use the currently indexed variable in a for loop as
an argument to a tag? Something like this:

{% for entry in entries %}
  {% include entry %}
{% endfor %}

Where `include` is a custom tag and `entry` is the variable from the
for loop and not the literal string "entry".

Thanks!

Tom

--
Tom Preston-Werner
GitHub Cofounder
http://tom.preston-werner.com