Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
So I have a multi-site setup with different sites (each with their own domain name) and a bunch of nodes that get shared across those sites:
I'm using a UrlProvider and ContentFinder implementation to assign the URLs to Node A and Node B for Site 1, 2 & 3.
This works fine and I can see the assigned URLs in the CMS and when I go to http://site1.example.com/listing/node-a it will load the correct node through the ContentFinder.
But the problem I have now is that to render things like the navigation/header/footer on that page I need to get the root site node. Normally I could do Model.AncestorOrSelf(1) (or Model.Site() in v7.5+) to get the site root node, but in this case it will get me the root node of the Node A content node (which is Shared Content).
What is the best way to get round this?
Can I somehow 'override' the parent node inside the ContentFinder when it assigns the IPublishedContent to the PublishedContentRequest?
Or would I need to get the virtual parent node (Listing in Site 1) by parsing the request URL and getting that node via the URL name instead?
Would something like this help?
If you scroll down to three bottom there is some code regards finding the correct site root of the publishedContentRequest is different from the domain root.
Thanks Jamie, that thread does contain a few pointers I can play around with.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted