From: "R. David Murray " <[EMAIL PROTECTED]>
> So, clearly I don't have a clue what stack is supposed to contain or
> what changing it does.  Can anyone point me to docs or give me some
> help?  You can also tell me, "that's stupid, just solve your problem
> this way"...

You've got it almost right, you just have to know that it's called a stack
because it's used that way by the publishing machinery.  This means that the
names on the stack are always in *reverse* order of how they appear in a
URL; "stack[-1]" is the next name to be traversed, not "stack[0]".

As you inferred, changing the stack will change the publishing path, and
your code, suitably adjusted, should do what you wanted.  Something like
this (in "/", not "/Books"):

stack = context.REQUEST['TraversalRequestNameStack']
if len(stack) >=2 and stack[-1] == 'Books' and stack[-2][:6] != 'manage':
    stack[-1:] = ['marketItems', 'store']

Note that unless you need it to exist for some other reason, you don't even
have to have an actual "/Books" Folder for this code to work, and you could
leave out the 'manage' check.


Evan @ digicool & 4-am

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to