https://github.com/ndarilek/mobile-sample
This project uses the MobileESP library to do user-agent analysis and
determine if a browser is mobile. I have snippets that should
theoretically detect if the device is mobile or full. Eventually I'll
tack on a cookie check but that isn't there yet.
Then I have a default template which embeds a mobile or full template.
At the moment I only embed the full template, but soon I'll add the
mobile version as well.
But for some reason, a "/" is displayed for the main content. I'm
guessing this is the HTML 5 parser failing on something and not
reporting it. Given that this happens at the bind point, I'm guessing
that it doesn't like the lift:-prefixed tag.
I'm a bit baffled that this works fine outside of an embed, but fails
when I try embedding. What am I doing wrong? I've also tried
eager_eval=true at various points but with no luck.
Thanks.
Found and fixed a stupid error in this sample, but it's still broken.
I'd inverted a < and /, which explained the presence of the stray / in
the output.
But now I get no output whatsoever. I've placed a few eager_evals in
various permutations, but no luck. I can't seem to get a bind in an
embedded template to trigger.
What am I missing? I'd really like to push a mobile interface for this
project.
Thanks.
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
go to http://localhost:8888/
and load your "designer friendly template"-file from your disk and
spot eventual problems and repeat the same procedure with the
processed template. Just be aware that the html5 parser will in most
(if not all) cases drop faulty nodes instead of generating a faulty
html5 page (this is outside of lifts control) so having a
"realistic" "designer friendly template" will help out.--
I probably misunderstand you but looking at your code you are using
<lift:embed what="_somethingToEmbed"/> <== not valid html5 (in default template)
and I am suggesting
<div class="lift:embed?what=_somethingToEmbed"></div> <== valid html5
and
<lift:bind name="main"></lift:bind> <== not valid html5 (in full template)
and I am suggesting
<div class="lift:embed?what=_somethingToEmbed"></div> <== valid html5
On Friday, November 11, 2011 at 10:23 AM, Peter Petersson wrote:
On 2011-11-11 18:48, Peter Petersson wrote:sry I mad a cut and past error this should be
I probably misunderstand you but looking at your code you are using
<lift:embed what="_somethingToEmbed"/> <== not valid html5 (in default template)
and I am suggesting
<div class="lift:embed?what=_somethingToEmbed"></div> <== valid html5
and
<lift:bind name="main"></lift:bind> <== not valid html5 (in full template)
and I am suggesting
<div class="lift:embed?what=_somethingToEmbed"></div> <== valid html5
<div class="lift:bind?name=content"></div>
sry I mad a cut and past error this should be
<div class="lift:bind?name=content"></div>
lift:bind is not a snippet.
Just use <div id="content">content goes here</div>