Switch to german | english active
Deutsch aktiv | umschalten nach Englisch
\\
In this example I use little flag images 23x15px //(CSS inserted)//.
In your [en] template please insert e.g.:
In your [de] template please insert e.g.:
~~UP~~
===== NAVIGATION =====
A simple verticle navigation at the right/left using the navigation tag **{NAV_LIST_UL:F ........**
* **en:** {NAV_LIST_UL:F,**01**,,act_path,active,,,}
* **de:** {NAV_LIST_UL:F,**11**,,act_path,active,,,}
\\
==== Combination of an horizontal & vertical navigation ====
E.g. The horizontal output
en: {NAV_LIST_UL:F,01,1,act_path,active}
de: {NAV_LIST_UL:F,11,1,act_path,active}
(one level deep).
E.g. the vertical sub output for an active **en_category_02** using the [[english:navigation:little-helper:level-lift|Level-Lift]].
##[en_category_01] **[en_category_02]** [en_category_03] [en_category_04]##
[PHP]
if(isset($GLOBALS['LEVEL_ID'][1])) {
$level_id = $GLOBALS['LEVEL_ID'][1];
echo ''.LF;
echo '{NAV_LIST_UL:F,'.$level_id.',,act_path,active,,,}';
echo '';
}
[/PHP]
Where LEVEL_ID'[**X**] is the level.
~~UP~~
\\
===== Switch for Different domains =====
**You only need this switch if every language has its own domain.** :!:
Forum: [[http://www.phpwcms.de/forum/viewtopic.php?p=73725#73725]]
There is a switch working with two domains **mydomain1.com** and **mydomain2.com** generating an HTTP Status Code: \\
##HTTP Status Code: HTTP/1.1 301 Moved Permanently##
$phpwcms['site'] = 'http://'.$_SERVER['SERVER_NAME'].'/'; \\
**$_SERVER['SERVER_NAME']** should always contain the current called Domain.
$LEVEL_ID[1] = 1
// Startpoint from mydomain2.com is the ID=11 -> $LEVEL_ID[1] = 11
//
// PHPWCMS_URL -> http://mydomainX.com/
// returnGlobalGET_QueryString() -> ?alias
// $aktion[0] == 0 -> pointer at the root level
if(isset($LEVEL_ID[1])) {
// Pointer behind the root level ?
// Yes -> check active Domain behind root level
if($LEVEL_ID[1] == 1 && strpos(PHPWCMS_URL, 'mydomain1.com') === false) {
// E.g. Using the ID=1 (for maydomain1.com) but with the domain maydomain2.com, than switch back to .mydomain1.com
// E.g. http://www.mydomain2.com/index.php?1-contact switch to http://www..mydomain1.com/index.php?1-contact
headerRedirect('http://www.mydomain1.com/index.php'.returnGlobalGET_QueryString());
} else {
// The same for the domain mydomain2.com
if($LEVEL_ID[1] == 11 && strpos(PHPWCMS_URL, 'mydomain2.com') === false) {
headerRedirect('http://www.mydomain2.com/index.php'.returnGlobalGET_QueryString());
}
}
} else {
// check root level for active Domain
if($aktion[0] == 0) {
// pointer on the root level e.g. http://mydomain1.com/ ??
if(strpos(PHPWCMS_URL, 'mydomain1.com')) {
// Yes, go to my startpage for the domain 1
header( "HTTP/1.1 301 Moved Permanently" );
headerRedirect('http:/www.mydomain1.com/index.php?mydomain1_start');
} elseif(strpos(PHPWCMS_URL, 'mydomain2.com')) {
// The same for domain 2
header( "HTTP/1.1 301 Moved Permanently" );
headerRedirect('http://www.mydomain2.com/index.php?mydomain2_start');
} else {
//redirect to "default" -> Fallback if there is an third domain or what ever
header( "HTTP/1.1 301 Moved Permanently" );
headerRedirect('http://www.default.com/index.php?default_start');
}
}
}
?>