Copied to clipboard

Flag this post as spam?

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


  • Saied 349 posts 674 karma points
    Jun 15, 2016 @ 16:09
    Saied
    0

    Create shared templates for multiple websites or separate templates for each website?

    Hi,

    Currently, I have 2 websites running under a single umbraco 7.4.3 instance. I am sharing the templates across the websites. For example, I have a home node that has a corresponding template and in order to show different content, I am doing something like this:

    @if(domain == "www.abc.com")
    {
        Show this
    }
    else if(domain == "www.def.com")
    {
      show that
    }
    

    Soon there will be a third site added and possibly a fourth and the templates will become unwieldy. My approach was to start separating them, breaking them apart, so there would be a home template for site A and a home template for site B, etc.

    I know this will lead to more files, but is there a best practice to this and is there anything such as a package that could help with this? Right now, I know I can make folders for document types, can we do the same for views?

    Also, if I create separate templates, should I create separate document types or just set the allowable templates for the single home document type in this example?

    Thanks a bunch, Saied

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies