David Koontz
2007-Apr-05 01:02 UTC
[Masterview-users] Creating a layouts/application.rhtml file
So I''m trying to use our main page to generate a site-wide layouts/application.rhtml file. The problem is, the main html starts with: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><div mv:replace="@title">Paybuyer Home</div></title> <link rel="stylesheet" href="css/style.css" type="text/css" mv:stylesheet="" /> </head> I initially put mv:generate="layouts/application.rhtml" at the end of the <!DOCTYPE> tag but that was not being seen as a generation directive (eg not showing up in the /masterview list of generated files and rake mv:view_rhtml failing). I tried putting <div mv:generate="layouts/application.rhtml"> with the closing div around the whole page, but now I get a parse error: ERROR MasterView: Failure to parse template. Exception=Declarations can only occur in the doctype declaration. Line: Position: Last 80 unconsumed characters: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org Is there any solution to this problem? How do you folks get the doctype declaration onto your pages? David Koontz
Hiroki Yoshioka
2007-Apr-05 13:15 UTC
[Masterview-users] Creating a layouts/application.rhtml file
Hi, David, On 4/5/07, David Koontz <david at koontzfamily.org> wrote:> So I''m trying to use our main page to generate a site-wide > layouts/application.rhtml file. The problem is, the main html starts with: > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > <html xmlns="http://www.w3.org/1999/xhtml"> > <head> > <meta http-equiv="Content-Type" content="text/html; > charset=utf-8" /> > <title><div mv:replace="@title">Paybuyer Home</div></title> > <link rel="stylesheet" href="css/style.css" type="text/css" > mv:stylesheet="" /> > </head> > > > I initially put mv:generate="layouts/application.rhtml" at the end of > the <!DOCTYPE> tag but that was not being seen as a generation directive > (eg not showing up in the /masterview list of generated files and rake > mv:view_rhtml failing).actually you can just put the declaration in the beginning of the template, without any mv:-directive. then it magically appears on the rendered page. hiro