Copied to clipboard

Flag this post as spam?

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


  • Jason Sypolt 2 posts 82 karma points
    May 14, 2018 @ 18:47
    Jason Sypolt
    0

    Referencing content from other content

    I am building a site where I would like to reuse HTML content in several places without having to enter and maintain it each place that it is needed. Something like an area of content that is able to be referenced from other areas of the site. Then if I need to update that content, I can just go to a single place to do it and every instance where it is used would reflect the changes.

    Example:

    Instructions Library
        Instruction Item 1
            Reference to Shared Content Item 1
            Reference to Shared Content Item 2
        Instruction Item 1
            Reference to Shared Content Item 1
            Reference to Shared Content Item 3
    Shared Content Items
        Shared Content Item 1
            Header
            Left Text Right Image
        Shared Content Item 2
            Header
            Left Image Right Text
        Shared Content Item 3
            Header
            Left Image Right Text
    

    In this example, I'm reusing Shared Content Item 1 and basically looping through all of the properties rendering a patient for each one based on the property type. I've figured that part out easily enough. So the template for Instruction Item 1 loops through its child nodes and then renders partials for each child node based on the node's type.

    What is a good practice for referencing a node (and its properties) from another node? I want this to be where content authors can create Shared Content Items once and then add them as children to an Instruction Item analogous to Lego blocks (except it is HTML).

    I've done this with Sitecore and other platforms, but I'm not familiar with how to do it with Umbraco.

  • Barry Fogarty 493 posts 1129 karma points
    May 14, 2018 @ 19:32
    Barry Fogarty
    100

    Hey Jason, you can build your content tree just as you have illustrated it in the example, and use a picker on the Instruction content type to pick items from your Shared Content Library. A multi node tree picker is the most common.

    In general terms, the best practice is to create a separate root node as a container for your shared content, which can be organised into folders. Then use an appropriate picker on the main 'webpage' nodes to make the link.

  • Jason Sypolt 2 posts 82 karma points
    May 15, 2018 @ 00:11
    Jason Sypolt
    0

    That was exactly what I needed, thanks!

Please Sign in or register to post replies

Write your reply to:

Draft