[Lift] Re: Why does HelloWorld index.html contain a snippet rather than a complete XHTML page?

2009-03-14 Thread Marc Boschma

Apologies for the poor wording, but David got the right  
interpretation

Marc

On 14/03/2009, at 6:57 PM, David Pollak wrote:

> index.html is well formed XML... in fact all the "html" files that  
> Lift reads must be well formed.  You may choose to include XML  
> header information in your document, however, that header  
> information will be used by the code that reads the document (e.g.,  
> defining the encoding as something other than UTF-8), but the  
> internal representation is normalized XML and the way that the XML  
> is rendered will always be UTF-8 encoded with proper headers.
>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Why does HelloWorld index.html contain a snippet rather than a complete XHTML page?

2009-03-14 Thread David Pollak
On Fri, Mar 13, 2009 at 10:40 PM, Marc Boschma

> wrote:

>
> Hi Mal,
>
> That aspect of the lift templating approach also warped my head for a
> while, having seen so many examples of the opposite approach (PHP,
> JSP, etc)...


Lift's use of  is my style and after doing a bunch of apps in
JSP, I think it's the right style.  But you can do whatever you want.  You
can  and  as much or as little as you want.  It's
your choice and it's best to choose the pattern that suits your developer
style.


>
>
> There is a certain part of me that still is unsettled about it, but I
> can see the advantages of it.
>
> Marc
> Ps. can the files such as index.html in the examples be full XML
> compliant documents?


index.html is well formed XML... in fact all the "html" files that Lift
reads must be well formed.  You may choose to include XML header information
in your document, however, that header information will be used by the code
that reads the document (e.g., defining the encoding as something other than
UTF-8), but the internal representation is normalized XML and the way that
the XML is rendered will always be UTF-8 encoded with proper headers.


>
>
> On 13/03/2009, at 3:30 PM, mal3 wrote:
>
> >
> > Why does HelloWorld index.html contain a snippet rather than a
> > complete XHTML page?
> >
> > When I first saw the HelloWorld example I thought there must be a
> > mistake,
> > because the index.html file contains a snippet, while default.html
> > contains
> > what looked more like a complete XHTML page.
> >
> > Why doesn't lift initially reference a complete XHTML page and then
> > pull in the snippet(s)?
> >
> > Is it to make it difficult/impossible for logic to creep into the
> > view?
> >
> > Mal.
> >
> > >
>
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Why does HelloWorld index.html contain a snippet rather than a complete XHTML page?

2009-03-13 Thread Derek Chen-Becker
Maybe I'm misunderstanding the question, too. I thought he meant having a
fully valid XHTML page for a template, but re-reading it he says
XML-compliant. Marc, could you clarify what you mean with an example?

Thanks,

Derek

On Fri, Mar 13, 2009 at 6:37 PM, Charles F. Munat  wrote:

>
> Maybe I'm not understanding the question, but it is perfectly possible
> to ignore the template and have index.html be anything you want. I have
> some pages that wrap the code with other templates (I use more than one,
> depending on the location on the site), and pages that stand alone. And
> I have pages that are generated entirely in the snippet. I also have
> URLS that respond with pure XML, some of which are generated in the
> snippet code, and others which are bound to a simple template in the
> webapp directory.
>
> Did I miss something?
>
> Chas.
>
> Derek Chen-Becker wrote:
> > Well, I just tested and this seems to not be the case :(
> >
> > On Fri, Mar 13, 2009 at 5:47 PM, Derek Chen-Becker
> > mailto:dchenbec...@gmail.com>> wrote:
> >
> > I think David could better answer this (I haven't looked at this
> > part of the code for a while), but I think that anything outside of
> > the  tag is tossed, so you could have a fully
> > compliant XML file that will only have a portion used.
> >
> > Derek
> >
> >
> > On Fri, Mar 13, 2009 at 5:40 PM, Marc Boschma
> >   marc%2blift...@boschma.cx >> wrote:
> >
> >
> > Hi Mal,
> >
> > That aspect of the lift templating approach also warped my head
> > for a
> > while, having seen so many examples of the opposite approach
> (PHP,
> > JSP, etc)...
> >
> > There is a certain part of me that still is unsettled about it,
> > but I
> > can see the advantages of it.
> >
> > Marc
> > Ps. can the files such as index.html in the examples be full XML
> > compliant documents?
> >
> > On 13/03/2009, at 3:30 PM, mal3 wrote:
> >
> >  >
> >  > Why does HelloWorld index.html contain a snippet rather than a
> >  > complete XHTML page?
> >  >
> >  > When I first saw the HelloWorld example I thought there must
> be a
> >  > mistake,
> >  > because the index.html file contains a snippet, while
> > default.html
> >  > contains
> >  > what looked more like a complete XHTML page.
> >  >
> >  > Why doesn't lift initially reference a complete XHTML page
> > and then
> >  > pull in the snippet(s)?
> >  >
> >  > Is it to make it difficult/impossible for logic to creep into
> the
> >  > view?
> >  >
> >  > Mal.
> >  >
> >  > >
> >
> >
> >
> >
> >
> >
> > >
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Why does HelloWorld index.html contain a snippet rather than a complete XHTML page?

2009-03-13 Thread Charles F. Munat

Maybe I'm not understanding the question, but it is perfectly possible 
to ignore the template and have index.html be anything you want. I have 
some pages that wrap the code with other templates (I use more than one, 
depending on the location on the site), and pages that stand alone. And 
I have pages that are generated entirely in the snippet. I also have 
URLS that respond with pure XML, some of which are generated in the 
snippet code, and others which are bound to a simple template in the 
webapp directory.

Did I miss something?

Chas.

Derek Chen-Becker wrote:
> Well, I just tested and this seems to not be the case :(
> 
> On Fri, Mar 13, 2009 at 5:47 PM, Derek Chen-Becker 
> mailto:dchenbec...@gmail.com>> wrote:
> 
> I think David could better answer this (I haven't looked at this
> part of the code for a while), but I think that anything outside of
> the  tag is tossed, so you could have a fully
> compliant XML file that will only have a portion used.
> 
> Derek
> 
> 
> On Fri, Mar 13, 2009 at 5:40 PM, Marc Boschma
> mailto:marc%2blift...@boschma.cx>> wrote:
> 
> 
> Hi Mal,
> 
> That aspect of the lift templating approach also warped my head
> for a
> while, having seen so many examples of the opposite approach (PHP,
> JSP, etc)...
> 
> There is a certain part of me that still is unsettled about it,
> but I
> can see the advantages of it.
> 
> Marc
> Ps. can the files such as index.html in the examples be full XML
> compliant documents?
> 
> On 13/03/2009, at 3:30 PM, mal3 wrote:
> 
>  >
>  > Why does HelloWorld index.html contain a snippet rather than a
>  > complete XHTML page?
>  >
>  > When I first saw the HelloWorld example I thought there must be a
>  > mistake,
>  > because the index.html file contains a snippet, while
> default.html
>  > contains
>  > what looked more like a complete XHTML page.
>  >
>  > Why doesn't lift initially reference a complete XHTML page
> and then
>  > pull in the snippet(s)?
>  >
>  > Is it to make it difficult/impossible for logic to creep into the
>  > view?
>  >
>  > Mal.
>  >
>  > >
> 
> 
> 
> 
> 
> 
> > 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Why does HelloWorld index.html contain a snippet rather than a complete XHTML page?

2009-03-13 Thread Derek Chen-Becker
I think I was confusing lift:ignore in there...

On Fri, Mar 13, 2009 at 6:12 PM, Jorge Ortiz  wrote:

> Yes, if index.xhtml is a compliant XML (preferably XHTML) document, it will
> just be served up as-is. The  tags define transformations that
> are applied to your document before it is served up.
>
> --j
>
> On Fri, Mar 13, 2009 at 3:40 PM, Marc Boschma 
> 
> > wrote:
>
>>
>> Hi Mal,
>>
>> That aspect of the lift templating approach also warped my head for a
>> while, having seen so many examples of the opposite approach (PHP,
>> JSP, etc)...
>>
>> There is a certain part of me that still is unsettled about it, but I
>> can see the advantages of it.
>>
>> Marc
>> Ps. can the files such as index.html in the examples be full XML
>> compliant documents?
>>
>> On 13/03/2009, at 3:30 PM, mal3 wrote:
>>
>> >
>> > Why does HelloWorld index.html contain a snippet rather than a
>> > complete XHTML page?
>> >
>> > When I first saw the HelloWorld example I thought there must be a
>> > mistake,
>> > because the index.html file contains a snippet, while default.html
>> > contains
>> > what looked more like a complete XHTML page.
>> >
>> > Why doesn't lift initially reference a complete XHTML page and then
>> > pull in the snippet(s)?
>> >
>> > Is it to make it difficult/impossible for logic to creep into the
>> > view?
>> >
>> > Mal.
>> >
>> > >
>>
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Why does HelloWorld index.html contain a snippet rather than a complete XHTML page?

2009-03-13 Thread Jorge Ortiz
Yes, if index.xhtml is a compliant XML (preferably XHTML) document, it will
just be served up as-is. The  tags define transformations that
are applied to your document before it is served up.

--j

On Fri, Mar 13, 2009 at 3:40 PM, Marc Boschma

> wrote:

>
> Hi Mal,
>
> That aspect of the lift templating approach also warped my head for a
> while, having seen so many examples of the opposite approach (PHP,
> JSP, etc)...
>
> There is a certain part of me that still is unsettled about it, but I
> can see the advantages of it.
>
> Marc
> Ps. can the files such as index.html in the examples be full XML
> compliant documents?
>
> On 13/03/2009, at 3:30 PM, mal3 wrote:
>
> >
> > Why does HelloWorld index.html contain a snippet rather than a
> > complete XHTML page?
> >
> > When I first saw the HelloWorld example I thought there must be a
> > mistake,
> > because the index.html file contains a snippet, while default.html
> > contains
> > what looked more like a complete XHTML page.
> >
> > Why doesn't lift initially reference a complete XHTML page and then
> > pull in the snippet(s)?
> >
> > Is it to make it difficult/impossible for logic to creep into the
> > view?
> >
> > Mal.
> >
> > >
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Why does HelloWorld index.html contain a snippet rather than a complete XHTML page?

2009-03-13 Thread Derek Chen-Becker
Well, I just tested and this seems to not be the case :(

On Fri, Mar 13, 2009 at 5:47 PM, Derek Chen-Becker wrote:

> I think David could better answer this (I haven't looked at this part of
> the code for a while), but I think that anything outside of the
>  tag is tossed, so you could have a fully compliant XML file
> that will only have a portion used.
>
> Derek
>
>
> On Fri, Mar 13, 2009 at 5:40 PM, Marc Boschma 
> 
> > wrote:
>
>>
>> Hi Mal,
>>
>> That aspect of the lift templating approach also warped my head for a
>> while, having seen so many examples of the opposite approach (PHP,
>> JSP, etc)...
>>
>> There is a certain part of me that still is unsettled about it, but I
>> can see the advantages of it.
>>
>> Marc
>> Ps. can the files such as index.html in the examples be full XML
>> compliant documents?
>>
>> On 13/03/2009, at 3:30 PM, mal3 wrote:
>>
>> >
>> > Why does HelloWorld index.html contain a snippet rather than a
>> > complete XHTML page?
>> >
>> > When I first saw the HelloWorld example I thought there must be a
>> > mistake,
>> > because the index.html file contains a snippet, while default.html
>> > contains
>> > what looked more like a complete XHTML page.
>> >
>> > Why doesn't lift initially reference a complete XHTML page and then
>> > pull in the snippet(s)?
>> >
>> > Is it to make it difficult/impossible for logic to creep into the
>> > view?
>> >
>> > Mal.
>> >
>> > >
>>
>>
>> >>
>>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Why does HelloWorld index.html contain a snippet rather than a complete XHTML page?

2009-03-13 Thread Derek Chen-Becker
I think David could better answer this (I haven't looked at this part of the
code for a while), but I think that anything outside of the 
tag is tossed, so you could have a fully compliant XML file that will only
have a portion used.

Derek

On Fri, Mar 13, 2009 at 5:40 PM, Marc Boschma

> wrote:

>
> Hi Mal,
>
> That aspect of the lift templating approach also warped my head for a
> while, having seen so many examples of the opposite approach (PHP,
> JSP, etc)...
>
> There is a certain part of me that still is unsettled about it, but I
> can see the advantages of it.
>
> Marc
> Ps. can the files such as index.html in the examples be full XML
> compliant documents?
>
> On 13/03/2009, at 3:30 PM, mal3 wrote:
>
> >
> > Why does HelloWorld index.html contain a snippet rather than a
> > complete XHTML page?
> >
> > When I first saw the HelloWorld example I thought there must be a
> > mistake,
> > because the index.html file contains a snippet, while default.html
> > contains
> > what looked more like a complete XHTML page.
> >
> > Why doesn't lift initially reference a complete XHTML page and then
> > pull in the snippet(s)?
> >
> > Is it to make it difficult/impossible for logic to creep into the
> > view?
> >
> > Mal.
> >
> > >
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Why does HelloWorld index.html contain a snippet rather than a complete XHTML page?

2009-03-13 Thread Marc Boschma

Hi Mal,

That aspect of the lift templating approach also warped my head for a  
while, having seen so many examples of the opposite approach (PHP,  
JSP, etc)...

There is a certain part of me that still is unsettled about it, but I  
can see the advantages of it.

Marc
Ps. can the files such as index.html in the examples be full XML  
compliant documents?

On 13/03/2009, at 3:30 PM, mal3 wrote:

>
> Why does HelloWorld index.html contain a snippet rather than a
> complete XHTML page?
>
> When I first saw the HelloWorld example I thought there must be a
> mistake,
> because the index.html file contains a snippet, while default.html
> contains
> what looked more like a complete XHTML page.
>
> Why doesn't lift initially reference a complete XHTML page and then
> pull in the snippet(s)?
>
> Is it to make it difficult/impossible for logic to creep into the
> view?
>
> Mal.
>
> >


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Why does HelloWorld index.html contain a snippet rather than a complete XHTML page?

2009-03-13 Thread David Pollak
Howdy,
A Snippet is the bridge between the view and Scala code.  In this example:


  Welcome to your project!
  


The  tag refers to the HelloWorld snippet which is
is some Scala code in the HelloWorld class.

Note the  tag.  This surrounds its body with a template
called "default".  The default.html file is located in the templates-hidden
directory (it can be located elsewhere, but that's the convention).  It has
all the "stuff" in it like  and style and menus.  This makes it
possible to change the look of a large part of your site by changing the
template rather than each page.

Thanks,

David

On Fri, Mar 13, 2009 at 4:30 AM, mal3  wrote:

>
> Why does HelloWorld index.html contain a snippet rather than a
> complete XHTML page?
>
> When I first saw the HelloWorld example I thought there must be a
> mistake,
> because the index.html file contains a snippet, while default.html
> contains
> what looked more like a complete XHTML page.
>
> Why doesn't lift initially reference a complete XHTML page and then
> pull in the snippet(s)?
>
> Is it to make it difficult/impossible for logic to creep into the
> view?
>
> Mal.
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---