Chris Withers wrote:
Jeff Peterson wrote:
I have a page template that calls a couple of scripts at the beginning, they are setting session objects and redirecting to a login screen if certain session objects don't exist.

Why not just use PAS or Cookie Crumbler? ;-)
I guess I could look at that...I am having to authenticate against an existing database of usernames and passwords so I just wrote it myself.

the content for this page. When the macro is rendered, the scripts fail to operate properly (commented out they work perfectly).

I'll bet your doing something like:

<mytag tal:define="dummy here/myScript"

The macro replaces the whole tag before the tal:define gets called.
Actually I am not doing anything of the sort.

The whole page is a macro to start. The scripts that are being called are all in this format:

 <metal:block metal:fill-slot="defines">
   <!-- define any template specific variables here -->
   <tal:x tal:define="baseurl context/root/baseurl"></tal:x>
   <tal:x tal:define="global session request/SESSION"></tal:x>
   <tal:x tal:condition="python:not session.has_key('user')">
<tal:x tal:define="bookmark context/commonRoot/bookmarks/setBookmark"></tal:x>
   <tal:x tal:condition="python:session.has_key('user')">
<tal:x tal:define="global accountname session/user/account_name; global username session/user/user_name; global account_id session/user/account_id; global roles session/user/role;
                               global uadm        python:'uadm' in roles;
                               global dadm        python:'dadm' in roles;
global padm python:'padm' in roles"></tal:x>

then below, the macro is being pulled in inside a different fill-slot.

Anyway, overarchingly, don't mix presentation and logic like this, 'cos it causes these kind of problems ;-)



Jeffrey D Peterson

fn:Jeffrey Peterson
org:Crary Industries;Information Systems
adr:;;237 12th Street NW;West Fargo;ND;58078;US
email;internet:[EMAIL PROTECTED]
title:Web Applications Developer

ZPT mailing list

Reply via email to