Created
October 3, 2016 09:52
-
-
Save JonasEriksson/40ae2364a081f0f3b755ffef9918361e to your computer and use it in GitHub Desktop.
Display different translations based on Mura site content directory structure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!--- Multilanguage sites often are structed with a "directory" structure of www.apple.com/se or www.apple.com/de for different languages. | |
| If your site uses this option in Mura (either a folder or page named accordingly (en, de, se, ...) with other pages below this), the following might be a simple solution for using | |
| templates for page layouts or components. ---> | |
| <!--- Mura Translations is a great plugin, but sometimes only a few small sections need to be translated, this is where is is one of probably many options ---> | |
| <!--- Note: The following commented out line is only required once per page, you could set this in the header for simplicity. ---> | |
| <!--- <cfset currentURL = "#CGI.SERVER_NAME#" & "#CGI.PATH_INFO#"> ---> | |
| <cfif currentURL CONTAINS '/en'> <!-- display english language --> | |
| <h3>This should show on the english "site".</h3> | |
| <cfelseif currentURL CONTAINS '/de' OR currentURL CONTAINS '/at'> <!-- display german language --> | |
| <h3>This should show on the german and austrian "site".</h3> | |
| <cfelse> <!-- display default language --> | |
| <h3>This should show on whatever your default language "site" is.</h3> | |
| </cfif> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment