*i'm guessing since i cannot see all of your code, but try something like
this:*
*
*
*$def with (content)

<head>
       <LINK REL=StyleSheet HREF="static/style.css" TYPE="text/css"
MEDIA=screen>*
*    $for region in content:
       <title> $content.title </title>

</head>
<body>*
*        $:region.content
</body>
</html>*


On Sun, Jun 6, 2010 at 1:22 PM, Dan Steingart <[email protected]>wrote:

> I've got a simple template:
>
> $def with (content)
>
> <head>
>        <LINK REL=StyleSheet HREF="static/style.css" TYPE="text/css"
> MEDIA=screen>
>        <title> $content['title'] </title>
>
> </head>
> <body>
>        $:content['body']
> </body>
> </html>
>
> where content is a dictionary passed from python, but when I try to
> load the page I get this error:
>
>
> <type 'exceptions.KeyError'> at /
> 'title'
>
> Python  templates/layout.html in __template__, line 4
> Web     GET http://localhost:8080/
>
> If I just use "$content" without an index, I see the dictionary
> represented as a string.  The tutorial indicates that dictionaries can
> be passed: what am I missing?
>
> Thanks in advance
>
> --
> You received this message because you are subscribed to the Google Groups
> "web.py" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected] <webpy%[email protected]>.
> For more options, visit this group at
> http://groups.google.com/group/webpy?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to