[xwiki-users] Including a page from another space and having access to its objects
Is it possible to include a page and have it execute as if it was still in that space (rather than in the parent pages space)? For example I have a News space and its WebHome page looks for documents with news post objects in that space. When I include News.WebHome from Main.WebHome it only sees news posts that are in the Main space rather than in the News space. Many thanks Radek Rekas
Hi, On Wed, Aug 25, 2010 at 04:01, Radek Rekas <[email protected]> wrote:
Is it possible to include a page and have it execute as if it was still in that space (rather than in the parent pages space)?
For example I have a News space and its WebHome page looks for documents with news post objects in that space.
When I include News.WebHome from Main.WebHome it only sees news posts that are in the Main space rather than in the News space.
With {{include}} macro you have a context handling parameters which is used to indicate what is the current document when including the document: * context="current" is the default and basically mean that the included document (News.WebHome) content is executed in the context of the includer document (Main.WebHome) * context="new" means that the included document (News.WebHome) is executed in a new isolated context in which it's the current document, i.e. it renders exactly like you where going to /bin/view/News/ See http://code.xwiki.org/xwiki/bin/view/Macros/IncludeMacro20 for more.
Many thanks
Radek Rekas
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne
try using {{include document="News.WebHome" context="new"/}} Radek Rekas wrote:
Is it possible to include a page and have it execute as if it was still in that space (rather than in the parent pages space)?
For example I have a News space and its WebHome page looks for documents with news post objects in that space.
When I include News.WebHome from Main.WebHome it only sees news posts that are in the Main space rather than in the News space.
Many thanks
Radek Rekas
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
participants (3)
-
Caleb James DeLisle -
Radek Rekas -
Thomas Mortagne