How to transclude pages or sections of pages (and how to navigate docs)

We are in the process of migrating an old Mindtouch instance over to DekiWiki. At the moment I am focused on translating some of the last few Dekiwiki scripts to Velocity.

I am a bit stuck on transclusion. In Mindtouch I can transclude a section from another page with the code {{ wiki.page(page, section) }}. Is this possible in Velocity in Xwiki and if so how would I do it?

I am finding the scripting documentation to be somewhat bewildering. As far as I can tell so far I would need to first do an $xwiki.getDocument(), if I can figure out the correct arguments. Then come the mystery steps of getting the contents of a section within that document and then inserting it into the page. Is there a simplified way to learn how to use the $xwiki and $doc objects, without just reading the extremely long doc pages from start to finish?

I have the feeling that what you need does not really require scripting at all. The include or display macros can display a specific page section.

Unless what you need is not to display that section, but to extract it and do other stuff with it in your script ?

I think display will do it. The only other thing I would like to do with it is provide a link to the page with the included content.

Is there somewhere a list of the “simple” extensions like this that allow basic wiki operations? The existing list of “recommended” extensions is a long list of arcane stuff that I have no interest in. Stuff like “include” and “display” are pretty basic, and I wonder what other good stuff is lurking in the list that I will never find.

<never mind, it appears it is already installed on our wiki, although it’s very hard to verify that in the extensions manager>

Another follow-up question: is there a way to easily get the path of the parent page so I can specify it in the Display macro?

The reference of a page contain its whole hierarchy, so the reference of the parent page is also the parent of the current page reference. You can find a few examples on how to get the current page reference in https://www.xwiki.org/xwiki/bin/view/FAQ/How%20can%20I%20get%20the%20reference%20of%20a%20page.