Copied to clipboard

Flag this post as spam?

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


  • Snehal 4 posts 24 karma points
    Aug 22, 2012 @ 16:55
    Snehal
    0

    How to use the same database and data as well as content to create different websites.

    Hi,

    I really could use some help, does anyone know how to use Umbraco to run different websites but using the same Content. So i do not want to add a new node for each website i need a centeral place to modify data. So for example, i have a website for New York about cars, i need to use a same data to create a website for Atlanta but the atlanta website might exclude certain cars or have new ones that New York website must not show.However i want a central place so if i have to modify a car i only do it in 1 place and it will reflect on all the websites.

    Im not sure if i am explaining this well enough please let me know if u can assist.

  • Dan 1288 posts 3921 karma points c-trib
    Aug 22, 2012 @ 17:33
    Dan
    0

    Hi Snehal,

    There are a few ways of doing this, but a sensible option might be to create your reusable-data structure in a content folder outside of the root node of the Umbraco content tree.  You could then create your websites as separate folders in the content root and use macros within your templates in these sites to pull data from the reusable-data node.  So your content tree might look like this:

    - Content
    - - Website1 (set a hostname on this node, like 'atlanta-cars.com')
    - - - Some page about cars
    - - - Another page about cars
    - - Website2  (set a hostname on this node, like 'new-york-cars.com') 
    - - - Some page about cars
    - - - Another page about cars
    - Reusable data
    - - Cars
    - - - Car 1
    - - - Car 2
    - - - Car 3
     

    So on the template which is used by the pages called 'Some page about cars' you'd have a Razor or XSLT macro which pulls content from the 'Cars' node in the data store.  You could use different templates to render macros which filter the cars pulled into these pages on a per-website basis.

    Hope this makes sense!

  • Snehal 4 posts 24 karma points
    Aug 23, 2012 @ 08:57
    Snehal
    0

    Hi Dan

    Thanks alot for your help, it does make sense, i will give it a shot.

    Thanks again.

  • Snehal 4 posts 24 karma points
    Aug 23, 2012 @ 10:49
    Snehal
    0

    Hi Dan

    Just 1 more question which might throw a spanner into the works, I already have all the content in the website folder and its a pretty huge website i have already created several components and data types so it will be pretty hard to shift them out of the current location. Is there perhaps an alternative to having the main content outside. Im not sure but could the Manage Hostname option be used in any way or is there another way to do this.

    Thanks

  • Snehal 4 posts 24 karma points
    Aug 23, 2012 @ 10:50
    Snehal
    0

    Thanks in advance

  • Dan 1288 posts 3921 karma points c-trib
    Aug 23, 2012 @ 11:19
    Dan
    0

    So effectively, you have the 'cars' data already in a website?  That's no problem - you can still create additional sites in the content root, set hostnames on them so they're effectively different websites on different domains, and build your macros to populate content in these additional sites from the main site tree.

Please Sign in or register to post replies

Write your reply to:

Draft