On Sat, Jun 28, 2014 at 6:53 PM, Shannon Cruey <
[email protected]> wrote:

> Thanks, that works, however it leads me to another issue.  Evidently,
> after encountering a $:if, the templator never stops assuming indendation.
>  This isn't working for me, as it forces the code indentation to be off
> kilter.
>
> For example:
>
> $if content.get('cssfiles'):
>     $for f in content.cssfiles.split():
>         <link type="text/css" href="$f" rel="stylesheet" />
>
>     </head>
>     <body>
>         <nav id="app_header" class="top-bar" data-topbar>
>
>
> I only want the $:if to apply to the next few lines.  Not all the way down
> to the </head>.
>
>  Know any way I can give the parser a 'hint' to stop reading downline
> indentation?
>
> I thought about using $else, but this isn't an else condition.
>

You could write it like this:

    $if content.get('cssfiles'):
        $for f in content.cssfiles.split():
            <link type="text/css" href="$f" rel="stylesheet" />

    </head>
    <body>
        <nav id="app_header" class="top-bar" data-topbar>

I agree that indentation creates trouble sometimes.

Anand

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/webpy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to