12

The traditional way to display a different language or content for a site in Tridion is to have the web publication publish its website in a different folder.

DD4T has a Publication Id that is set in the web.config to tell it which Publication to look for when querying the Broker database.

Is there a way to remove this so that the same DD4T application can be used to display content in different languages/from different publications?

If so, what needs to be thought about in order for this to work?

Is there a more optimal way to do this that gives more of a traditional approach e.g using MkLink to symlink many web folders so deployments are easier?

I would like to avoid having to deploy my application multiple times if possible.

2

2 Answers 2

13

Yes it can. In short: implement a mechanism to find the corresponding publicationId for a request/url. Luckily this is part of DD4T, thanks to Quirijn. Read more about it on his blog:

http://blog.trivident.com/dd4t-web-publication-resolving/

1

So yes, it is possible to host more than one site on a DD4T implementation. You need to write your own IPublicationResolver and map it. Or You could borrow any of these two publication resolvers from DXA:

Using the dynamic_conf.xml from the config folder to resolve the publication id:

https://github.com/sdl/dxa-web-application-dotnet/blob/f490a838b9c5f8b144eb59c6a4e1c88b18edb632/Sdl.Web.Tridion/CdConfigLocalizationResolver.cs

or

Using the discovery service (Web 8) to resolve the publication id:

https://github.com/sdl/dxa-web-application-dotnet/blob/f490a838b9c5f8b144eb59c6a4e1c88b18edb632/Sdl.Web.Tridion/CdApiLocalizationResolver.cs

Good luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.