Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Vincent Baaij 95 posts 344 karma points c-trib
    Dec 01, 2014 @ 15:23
    Vincent Baaij
    0

    Repository for content but not for context

    All,

    Suppose I have the following structure:

    -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.

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Dec 01, 2014 @ 16:19
    Dave Woestenborghs
    0

    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

  • Vincent Baaij 95 posts 344 karma points c-trib
    Dec 01, 2014 @ 16:43
    Vincent Baaij
    0

    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. :(

  • Stephen 767 posts 2273 karma points c-trib
    Dec 01, 2014 @ 17:15
    Stephen
    0

    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 ;-)

  • Vincent Baaij 95 posts 344 karma points c-trib
    Dec 01, 2014 @ 19:53
    Vincent Baaij
    0

    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?

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Dec 02, 2014 @ 08:21
    Dave Woestenborghs
    0

    Hi Vincent,

    Can you tell me how you link your items from your repository in your site ?

    Dave

Please Sign in or register to post replies

Write your reply to:

Draft