Hi All,
Recently in a project with Caroline we have used some packages and integrated
ones with others, we usually found ourselves writing pages with includes from
other packages pages.
But the include is not always an easy way to reuse the code from other package
because most of them must be modified (and probably you don't want to modify
them), specially because the pages are written to work by themselves (in the
package page-flow) and not for being used as includes, that's specially true
in the templates and in the variable passing (forms/urls, POST/GET).
I think the best possible way is to define an special include that will fool
that kind of pages, taking out their original master template & handling
well the form & url variable passing between them, in this way you avoid
changing the actual code of any package that you might use; the other possible
way will be to change to a special ad_page_contract & and changing the master
tag, but this is probably not the most elegant way to handle this.
The real cool thing if is defined a new include tag will be to:
- Override automatically the package master template and put instead the callers
master template or for the most of the cases, just do not use that package
master template.
- Make it able to handle all the variable passing (urls, post/get), probably
with some sort of proc like rp_form_put
- The ability to make it return to a URL that you want after or before some
page is called in that package.
- The possibility to send the package mapped directory, in order to identify
to which instance of that package you want, so you can manage multiple instances
of the same package for your application.
This is a real need for openacs and for any of the related projects.
Anyone has thoughs about this?