Message from discussion
data-lift question
Received: by 10.204.129.78 with SMTP id n14mr425872bks.5.1324549040744;
Thu, 22 Dec 2011 02:17:20 -0800 (PST)
X-BeenThere: liftweb@googlegroups.com
Received: by 10.204.200.144 with SMTP id ew16ls30079348bkb.2.gmail; Thu, 22
Dec 2011 02:17:15 -0800 (PST)
Received: by 10.205.132.133 with SMTP id hu5mr425313bkc.4.1324549035131;
Thu, 22 Dec 2011 02:17:15 -0800 (PST)
Received: by 10.205.132.133 with SMTP id hu5mr425312bkc.4.1324549035119;
Thu, 22 Dec 2011 02:17:15 -0800 (PST)
Return-Path: <petersson.pe...@gmail.com>
Received: from mail-lpp01m010-f45.google.com (mail-lpp01m010-f45.google.com [209.85.215.45])
by gmr-mx.google.com with ESMTPS id e4si7481729bkv.1.2011.12.22.02.17.15
(version=TLSv1/SSLv3 cipher=OTHER);
Thu, 22 Dec 2011 02:17:15 -0800 (PST)
Received-SPF: pass (google.com: domain of petersson.pe...@gmail.com designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of petersson.pe...@gmail.com designates 209.85.215.45 as permitted sender) smtp.mail=petersson.pe...@gmail.com; dkim=pass (test mode) header...@gmail.com
Received: by mail-lpp01m010-f45.google.com with SMTP id s15so4716676lag.18
for <liftweb@googlegroups.com>; Thu, 22 Dec 2011 02:17:14 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=message-id:date:from:user-agent:mime-version:to:subject:references
:in-reply-to:content-type:content-transfer-encoding;
bh=gebMKeHuDbsVNZsjTSkic07smkwuED1+f72urf3W0Mo=;
b=ZaoeGEzx6jYEo0wSEie9ONC3L+pF0zoPXFv5uGccJ+BGm5u4lQ5DaEHePM2vXWWS19
iitmavdwG7fbzWUoAoykdhYwVd4VIMKIhQHuws+vGe1MSdwM3dZgBv74uUXiEqWXtTbP
UP5iBMgcd6oI4vEnbSMaUehjeItUiINNt2YRo=
Received: by 10.152.105.84 with SMTP id gk20mr8534630lab.10.1324549034902;
Thu, 22 Dec 2011 02:17:14 -0800 (PST)
Return-Path: <petersson.pe...@gmail.com>
Received: from [10.48.37.175] ([82.99.38.11])
by mx.google.com with ESMTPS id nu4sm7070532lab.4.2011.12.22.02.17.13
(version=TLSv1/SSLv3 cipher=OTHER);
Thu, 22 Dec 2011 02:17:14 -0800 (PST)
Message-ID: <4EF303A8.5090...@gmail.com>
Date: Thu, 22 Dec 2011 11:17:12 +0100
From: Peter Petersson <petersson.pe...@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111124 Thunderbird/8.0
MIME-Version: 1.0
To: liftweb@googlegroups.com
Subject: Re: [Lift] data-lift question
References: <4EF2F4DE.70...@gmail.com> <m2liq5rl78....@ingolfs.dk>
In-Reply-To: <m2liq5rl78....@ingolfs.dk>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
On 2011-12-22 10:48, Jeppe Nejsum Madsen wrote:
> Peter Petersson<petersson.pe...@gmail.com> writes:
>
>> Hi
>>
>> I am in the process of switching to use data-lift="xxxx" in favor for
>> class="lift:xxxx" and it works great.
>> However I expected it to work on the body tag as well but I could not
>> get it to parse, am I wrong in assuming it should work ?
>>
>> For instance take a look at my Basic-SquerylRecord-User-Setup example
>> https://github.com/karma4u101/Basic-SquerylRecord-User-Setup/blob/master/src/main/webapp/index.html
>>
>> ...here I have switched to data-lift every ware possible expect for
>> the following:
>>
>> <body class="lift:content_id=main">
>>
>> witch I assumed I would be able to write:
>>
>> <body data-lift="content_id=main">
>>
>> but it dose not work.
> I think the data-lift only works for snippets and the content_id is not
> a snippet, but a special-cased marker.
>
> It would be nice to support not using the class attribute for anything
> Lift related.
>
> Otoh, since content_id is not a snippet perhaps we should not use
> data-lift="content_id=main" but something else like data-lift-content-id="main"
>
> Wdyt?
Thanks for the explanation Jeppe, now that I realize it is a
"special-cased marker" and not a snippet it makes sense.
Yes I agree that it would be great to be able to use data-lift for
everything lift related in the templates.
Your suggestions is good, personally I think sticking with data-lift
would be the cleanest approach from a user perspective as it would
probably feel more natural and generate less questions on this list.
How about, in addition to this "special-cased marker", add a new built
in snippet, allowing for a alternative syntax and use it something like
this <body data-lift="content?id=main"> ?
best regards
Peter Petersson
>
> /Jeppe
>