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 Data Access in Templates

Received: by 10.180.104.133 with SMTP id ge5mr277603wib.1.1342680093535;
        Wed, 18 Jul 2012 23:41:33 -0700 (PDT)
X-BeenThere: zotonic-users@googlegroups.com
Received: by 10.180.81.71 with SMTP id y7ls2682306wix.3.gmail; Wed, 18 Jul
 2012 23:41:33 -0700 (PDT)
Received: by 10.216.244.135 with SMTP id m7mr95941wer.2.1342680093040;
        Wed, 18 Jul 2012 23:41:33 -0700 (PDT)
Received: by 10.216.244.135 with SMTP id m7mr95940wer.2.1342680093026;
        Wed, 18 Jul 2012 23:41:33 -0700 (PDT)
Return-Path: <scherpeni...@gmail.com>
Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181])
        by gmr-mx.google.com with ESMTPS id cx9si276132wib.0.2012.07.18.23.41.32
        (version=TLSv1/SSLv3 cipher=OTHER);
        Wed, 18 Jul 2012 23:41:32 -0700 (PDT)
Received-SPF: pass (google.com: domain of scherpeni...@gmail.com designates 209.85.212.181 as permitted sender) client-ip=209.85.212.181;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of scherpeni...@gmail.com designates 209.85.212.181 as permitted sender) smtp.mail=scherpeni...@gmail.com; dkim=pass header...@gmail.com
Received: by wibhm2 with SMTP id hm2so2010034wib.16
        for <zotonic-users@googlegroups.com>; Wed, 18 Jul 2012 23:41:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=sender:message-id:date:from:user-agent:mime-version:to:subject
         :references:in-reply-to:content-type:content-transfer-encoding;
        bh=wPqOJ+aCahCh3Nz5V6/Cuw/QZY8HKXdDG6v6l9uSSxc=;
        b=zAXqw25yZrIFwdgTLw+og2+0bZxlII617MIcikB4Oi0rnHJINSX03NXy0iOZqTwnvm
         /A1UV0Zx4lE+YocxvjYG7MxYSNcUC/0BB67BF3wbPaC3fGmOq4x1zGIXtUgWX47Imy6G
         TuNzsqb9sucb1DIoCTHLW8xGB+BvLRJRARQ8y5kBQUTlw53LIWvcm0CocHL7htmX6zwb
         JaeFydDpbYS85TSK6ZI6ugzlD843DRQzmLn0uHwgrKJdMnNRO83iGpjalmdiqKlnd17m
         ucaJQgnyuTnKvYhq4L+3MjUSeVYAmoGJuDFfaRsGz7lvsjhrzlxf4iIXreMda8fKKwAa
         DcWw==
Received: by 10.216.101.68 with SMTP id a46mr376534weg.120.1342680092005;
        Wed, 18 Jul 2012 23:41:32 -0700 (PDT)
Return-Path: <scherpeni...@gmail.com>
Received: from [10.0.0.102] (dhcp-077-251-135-133.chello.nl. [77.251.135.133])
        by mx.google.com with ESMTPS id x46sm2964110eel.6.2012.07.18.23.41.30
        (version=SSLv3 cipher=OTHER);
        Wed, 18 Jul 2012 23:41:30 -0700 (PDT)
Sender: Arjan Scherpenisse <scherpeni...@gmail.com>
Message-ID: <5007AC15.1080...@scherpenisse.net>
Date: Thu, 19 Jul 2012 08:41:25 +0200
From: Arjan Scherpenisse <ar...@scherpenisse.net>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1
MIME-Version: 1.0
To: zotonic-users@googlegroups.com
Subject: Re: [Zotonic-Usr] Data Access in Templates
References: <56f3bf95-56a1-463c-a8a5-f4c5e3bfd65e@googlegroups.com> <4DD0AB0A-DFCD-43F1-865A-9DE7D0BF2...@me.com> <CAFjCMHuy_WsOZ96gx6x65GU_cZtQ85z-BAJapfQ59PvUqE1...@mail.gmail.com>
In-Reply-To: <CAFjCMHuy_WsOZ96gx6x65GU_cZtQ85z-BAJapfQ59PvUqE1...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Yes, but Behrad says that he converts the proplist keys to atoms before
passing them to Erlydtl.
So indeed, the question for Behrad is how the variables look just before
they are handed off to Erlydtl?

Arjan

On 07/19/2012 06:48 AM, Wes James wrote:
> You have ' ' around Data, he has "" around his item.  Isn't yours an
> atom and his a string and how does zontonic treat the difference?
> 
> wes
> 
> On Wed, Jul 18, 2012 at 4:54 PM, Marc Worrell <mworr...@me.com
> <mailto:mworr...@me.com>> wrote:
> 
>     That is strange, I just tried it on the command line and it works there:
> 
>>     (zotonic...@Lamma.local <mailto:zotonic...@Lamma.local>)5>
>>     erlydtl:compile(<<"{{ v.Data }}">>, t, z:c(zotonic_status)).
>>     {ok,t}
>>     (zotonic...@Lamma.local <mailto:zotonic...@Lamma.local>)6>
>>     t:render([{v, [{'Data',123}]}], z:c(zotonic_status)).       
>>     {ok,["123"]}
> 
>     How does your variable list look like?
> 
>     - Marc
> 
> 
>     On 19 jul. 2012, at 00:47, Behrad Zari wrote:
> 
>>     I have a list of tuples like
>>
>>         [ { "Param1", "value1" }, { "Param2", "value2"} ], ...
>>
>>     I found that converting first tuple keys to atoms 'Param1' is not
>>     sufficient to access them
>>     in my template via {{props.Param1}} !!! Params are starting with
>>     upper-case characters!
>>
>>     What is the best practice structure that I should convert my data
>>     to, to use it simply in templates!?
>>
> 
>