That would cover my use case, certainly. So far I am using each of my elements exactly once.

Maybe there should be a warning logged if there's more than one match for a given class, just in case people include the same element in several places. I wouldn't mind having to use an ID if there was ambiguity about which element I meant.

This is probably what you have in mind already, but it should use the first element declared with the destination class in the current subsite, *then* search other subsites. I bet most of the time if you use the same element in multiple places you will want to refer to the local one. Plus that makes the system keep working as it does today if you're referring to local instances of elements.

What are some examples of places where you'd want to use an element in multiple subsites? About the only case I can think of is if you have an element that should be accessible only by two distinct sets of users (so you'd put it in two different authentication-required subsites.) In that case searching the local subsite first would definitely be the desired behavior.

One other stray thought: To keep the benefit of referring to the class object while still allowing you to disambiguate, maybe there should be a way to specify which subsite you want without knowing the ID of the element. E.g., if your destId points to a subsite name rather than an element, and there's a destClass, RIFE tries to search for that class in the given subsite. Or maybe a separate destSite attribute would be better so as not to overload destId.

-Steve


Geert Bevin wrote:
Hi Steven,

at the moment this is intended behavior by lack of a better solution. The problem is that for RIFE there is no way of knowing which element ID you mean when you point it to a destClass. The element can be included many times, with different IDs and in different sub-sites.

A solution that I now think of is that instead of just assuming that the element resides in the same sub-site, that logic could be changed to selecting the first element declared with the destination class as its implementation. What do you think? Would that work? It seems that it would cover most of the things that people expect when using it.

Best regards,

Geert

_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to