[z3-checkins] Re: r10172 - z3/Five/branch/regebro-standard_macros
Philipp von Weitershausen
philipp at weitershausen.de
Thu Mar 31 12:48:03 MEST 2005
Lennart Regebro wrote:
> Philipp von Weitershausen wrote:
>
>> So, if your argument is that we want to reuse subclasses of
>> StandardMacros,
>
>
> Well, it isn't. I don't follow you here.
>
>>> My bad, I ment to say templates, not skins. I'll try again:
>>> "Without them PTs made for Five can't be used in Zope3 and PTs in
>>> Zope3 can't be used in Five." That's what I ment to say.
>>
>>
>> Now, *that* I don't understand. Why are templates not compatible?!?
>
>
> Because in Five you have to do: here/main_template/macros/master,
Since when? Why? No! Please not! Why can't we be compatible with the
Zope 3 syntax and do context/@@standard_macros/page?
> where
> you in Z3 do context/@@standard_macros/main. Also, in Z3 macros you can
> do context/@@standard_macros/somethingsomething or
> context/form_macros/somethingsomething and in Five you can't, because
> these doesn't exist, because they are skipped, because they use a
> StandardMacros based on new-style classes.
We used to be able to do context/@@standard_macros/some_macro, and I
think we still can. I'm not sure where you draw that assumption from
that we can't or shouldn't.
>>> Yes, we have to reregister the StandardMacros and relations,
>>> form_macros, et al. I can't currently remember if I tried just
>>> registering StandardMacros (I think I did, but are only like 90%
>>> sure), so I'll try that again. It could have been that it didn't work
>>> because of something else as well...
>>
>> form_macros, navigation_macros, etc. etc. are all ZPTs that can be
>> registered with Five's browser:page without any problem.
>
> Yes, but the Zope3 registering uses StandardMacros as a view. As I
> understand it, if we want to use Fives StandardMacros we have to
> re-register them. But since we don't know where they are located, we
> have to first copy and paste these ZPTs into five, so we CAN re-register
> them.
I see now where your false assumption is. We don't have to re-register
the ZPTs that StandardMacros points to. StandardMacros keeps an ordered
list of names of ZPT views. When you do
context/@@standard_macros/some_macro_name
it goes through all of those views and tries to get the macro
'some_macro_name' from them and returns the first one it finds.
So, the coupling between StandardMacros and the ZPTs is loose. All that
StandardMacros has is a list of browser view names. Nothing more.
>> Seriously, I'd really like to avoid a monkey if all it takes for a
>> Zope 3 skin to be used in Five is implementing and registering the
>> StandardMacros class.
>
> Sure. I'm not convinced that is all it takes though, but I'll try.
Please do. If you run into problems, they might come from somewhere
else. Also, you haven't really told me WHY you're not convinced...
I'm 99.9% certain that we don't have to copy every damn template to
Five. That's the least thing I want to do. And it's absolutely not
necessary, because we have Five's browser:page that registers Zope 3's
template just fine. THe only problem is Zope 3's StandardMacros which we
have to reimplement and reregister. But now I'm repeating myself...
Philipp
More information about the z3-checkins
mailing list