-Content
--Site 1
---News folder linked from repository
----News item linked from repository
----News item NOT linked from repository
--Site 2
---News folder linked from repository
----News item linked from repository
--Repository
---News folder
----News item
If I want to share content from the repository, I can do that by adding a content picker to the document types where I want to re-use. However that would require specific code in the view. I have to get the value form the content picker, make an IPublishedContent from it and then do GetPropertyValue<> for all the field I want to show.
If I use an umbracoInternalRedirectId, I get the right propertydata, but the context of the request (parent, siblings, children) is also changed to the repository item.
Is it possible to code this in a way that I can use Model.Content in the view but that the propertydata is coming out of the repository item? A kind of internal redirect for the data only.
Thanks. Saw this one too. In the comments Stephan hints at a multi-site/multi-domain solution. I've looked at the Umbraco source, but haven't figured out how to do that yet. According to the other comments so haven't Warren and Jeroen. :(
As far as I can tell... there's no real way you can have "Model" contains values from a content coming from the repository yet at the same time pretend it's part of the main site tree. You cannot really redirect the "data" and not the tree structure. At least not OOTB. It might be possible to write your own wrapping IPublishedContent that would get its properties values from another IPublishedContent. Might be... someone has to try ;-)
So, I might take a shot at that. There is however a reasonable chance I fail miserably. What would then, in your opinion, be the best way to share content on multiple sites from a repository in one instance?
Repository for content but not for context
All,
Suppose I have the following structure:
If I want to share content from the repository, I can do that by adding a content picker to the document types where I want to re-use. However that would require specific code in the view. I have to get the value form the content picker, make an
IPublishedContent
from it and then doGetPropertyValue<>
for all the field I want to show.If I use an
umbracoInternalRedirectId
, I get the right propertydata, but the context of the request (parent, siblings, children) is also changed to the repository item.Is it possible to code this in a way that I can use
Model.Content
in the view but that the propertydata is coming out of the repository item? A kind of internal redirect for the data only.Hi Vincent,
Warren has a blog about hooking into the pipeline and setting the content for the request. Maybe this can be a starting point for you ?
http://creativewebspecialist.co.uk/2013/12/03/using-umbraco-pipeline-for-member-profile-urls/
Dave
Dave,
Thanks. Saw this one too. In the comments Stephan hints at a multi-site/multi-domain solution. I've looked at the Umbraco source, but haven't figured out how to do that yet. According to the other comments so haven't Warren and Jeroen. :(
As far as I can tell... there's no real way you can have "Model" contains values from a content coming from the repository yet at the same time pretend it's part of the main site tree. You cannot really redirect the "data" and not the tree structure. At least not OOTB. It might be possible to write your own wrapping IPublishedContent that would get its properties values from another IPublishedContent. Might be... someone has to try ;-)
Stephen,
So, I might take a shot at that. There is however a reasonable chance I fail miserably. What would then, in your opinion, be the best way to share content on multiple sites from a repository in one instance?
Hi Vincent,
Can you tell me how you link your items from your repository in your site ?
Dave
is working on a reply...