> ro wrote:
> > hi all
> >
> > I have change code as this:
> >
> > <?python if not current_page: page_set = space.root_pages elif
> > current_page: page_set = current_page.sub_pages ?>
> >
> > ${display_pages(page_set)}
> >
> > It worked, but I think it is not the best way...
> >
> You could also do something like:.
>
> ${display_pages(current_page and current_page.sub_pages or
> space.root_pages)}

It is very cool.
Which document introduce the syntax like this?

>
> Although that is not quite as readable.
>
> The problem is that code inside a python processing instruction is
> evaluated as Python code, which is different from markup which is
> streamed inline. What you did isn't bad. There are several ways of
> doing what you want. Another possible alternative:
>
> <div py:if="current_page"
> py:replace="display_pages(current_page.sub_pages)"/>
> <div py:if="not current_page"
> py:replace="display_pages(space.root_pages)"/>
>
> I'm sure there are some others as well.
>
>
> David
>


-- 
with kind regards

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
kid-template-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kid-template-discuss

Reply via email to