How to include page from one package into another?

I am trying to create a package which will collect UIs from various WM packages into one.

I have the core site in pub folder of one package and wanted to use %include% method. But, if I wanted to use entire URL, it doesn’t work. neither using just pathname.

Only what will allow to load the page from another package is relative path to the index.dsp of the package.

%include ../../../anotherPackage/pub/index.dsp%  

Problem with this solution is that in case that the anotherPackage/pub/index.dsp contains also some includes locally from the package then they are not loaded because the “cursor” is still pointing to the master package from which I have the anotherPackage/pub/index.dsp included.

Anyone fought with same problem? Exists there any other way than how to solve it?

You can specify the absolute path (“/packagename/…”). I think, the IS instance is the place you start from. I just don’t know whether you should include “pub” into the path, ie. “/packagename/page.dsp” or “/packagename/pub/page.dsp”. Try it and find out!