If you are "linking" in the database using the pageid (vw_page.pageid), then you can fetch the page using:
Code:
$page = \vw_Hard_Core::controller('Fetch')->get('Page', $pageid);
If you are looking up pages via arbitrary criteria, you should invoke XenForo's search logic and filter results to vwpage results only.
If you are looking up pages via name, you can query against vw_route.itemkey
Itemkeys are formatted using:
Code:
\vw_Hard_Core::model('Encode')->encode(\vw_Hard_Core::model('String')->tolower($title));
When querying vw_route, filter itemtypeid on
Code:
\vw_Hard_Core::model('Node')->id('Page')
Then the result itemid field will be pageids you can use as mentioned above.
As for how you are doing the calendar-to-page linking from an experience perspective...
a. A calendar event automatically has a new page created (then it's easy to get and store the pageid)
b. use a chooser widget to pick the wiki page that gets linked. Probably the easiest/most drop-in way is to use the "Integration" system, which would require:
- creating a vw_node record for your content-type
- creating a /src/addons/vw/vw/_core/model/node/ class for that content-type establishing its flags
- creating a custom integration position (such as 'main:event') and calling that position in a template like
Code:
{{ vw_integrate('main:event', $eventDataArray) }}
$eventDataArray should be your $eventEntity->toArray();
Please see how
src/addons/vw/vw/XF/Entity/Thread.php does getItemid, getItemtypeid, toArray, and getStructure, for help getting an array that will work properly with the integration system.
Due to the way XenForo's templater works, I strongly recommend keeping your VaultWiki-related template code in a separate template and only including it if VaultWiki is enabled (easy way is check if the main class exists):
Code:
if (class_exists('vw_Hard_Core', false)