Zum Inhalt springen

sr_language_menu + realurl

Erstellt am 15. April 2012 · 13 Antworten · letzte Antwort am 2. Mai 2012

Tags: Frage

typo3_hp ·

Guten Abend!

Ich habe nun nachdem die Extension "sr_language_menu" soweit funktioniert hat (ohne RealUrl) RealUrl mitkonfiguriert.

Wenn ich in der Sprachauswahl auf Englisch klicke, baut er die lokale Seite auch um domain.de/en/impressum, jedoch verlier ich bei einem Seitenwechsel die Sprachauswahl. Was muss ich noch machen?

Danke und Grüße

TS:

config.sys_language_mode = content_fallback ;
# SPRACHWAHL
# **********************
config (
  sys_language_mode = strict; 0
  config.sys_language_overlay = hideNonTranslated
  sys_language_uid = 1
  linkVars = L
  language = de
  locale_all = de_DE.UTF-8
)
page.config (
  language = de
  locale_all = de_DE.UTF-8
)
# English language, sys_language.uid = 1
  [globalVar = GP:L = 2]
config.sys_language_uid = 2
page.config.language = en
page.config.locale_all = en_EN.UTF-8
[global]

sprachwahl.languageMenu < plugin.tx_srlanguagemenu_pi1

Constants:

## language menu konfigurieren
plugin.tx_srlanguagemenu_pi1 {
useSysLanguageTitle = 0
defaultLanguageISOCode = DE
LanguageISOCode = DE
#
#Hiermit kann die wraps um die Links aendern/leeren
#link.CUR.stdWrap.wrap = <li class='CUR'>|</li>
#link.NO.stdWrap.wrap = <li class='NO'>|</li>
link.NO.stdWrap = |
#
# CPG ausgeschalten!
#hideIfNoAltLanguages = 1
#
#Hiermit kann die aktuelle Sprache ausgeblendet werden
#don't show current language if showCurrent=0
#showCurrent = 0
#
# Hier liegt das selbst angepasste Template-File
file.templateFile = fileadmin/templates/sprachwahl.tmpl
#
#GIBT EINE LISTENANSICHT AUS (2: Liste, 1: Auswahlliste, 0:Flagge)
defaultLayout = 0
links.stdWrap.split.wrap >
_CSS_DEFAULT_STYLE >
#
#Hiermit koennte man festlegen, dass nur die Spachen 1+2 in der Liste ausgegeben werden
#languagesUidsList = 1,2
}

Real-URL läuft im Standardmodus (Standardinstallation ohne Anpassungen)

lediglich folgendes TS:

# RealURL aktivieren ./. Achtung zwingen / hinter Domain wg. Klick vergrößern Pmkslimbox
config.simulateStaticDocuments = 0
config.baseURL = http://project.de/
config.tx_realurl_enable = 1
config.prefixLocalAnchors = all

Danke und Grüße

typo3_hp ·

Guten ABend!

Hat niemand einee Idee?

Wie gesagt, nach einem KLick auf einen Link, springt die Website wieder auf die Defaultsprache zurück!

freshman17 ·

In der Realurl-Konfigurationsdatei die Sprach-Ids eingetragen?
Was genau ist damit gemeint: "..jedoch verlier ich bei einem Seitenwechsel die Sprachauswahl"?

typo3_hp ·

Hallo!

Wenn ich auf der Seite auf die Flagge "Englisch" klicke, wird die Seite auf Englisch geladen.

Domain lautet dann: Domain.de/en/contact

Wenn ich dann eine andere Seite im Menü anklicke, wird diese auf Deutsch geladen ( das /en/ in der Domain Ist dann auch weg!)

Wie bekomme ich es hin, dass die danach besuchten Unterseiten dann auch auf Englisch geladen wird?

Wie trage ich diese Sprach-IDs ein, gibt es Beispiele?

Danke und Grüße

freshman17 ·

klar gibt es Anleitungen, hier z.B.: #67175
Punkt 3 wäre das dann.
Alternativ:
1. du erstellst in typo3conf eine Datei realurlconf.php
2. im Backend->Extensions->RealUrl bei "Enable automatic configuration" dem Hacken raus und bei "Path to configuration file" den Pfad "typo3conf/realurlconf.php" eintragen
3. die angefügte realurlconf.php öffnen, die Sprach-Ids und die Rootpage ID an deine anpassen, auf den Server laden

Gruß

realurlconf.zip
1kB
typo3_hp ·

Hallo!

Vielen Dank!

Habe ich jetzt so gemacht (Haken raus, angepasst, Caches gelöscht), allerdings lädt er nach wie vor nur die aktuelle Seite auf Englisch.

Sobald ich im Menü eine andere anklicke (Übersetzung existiert!), wird diese auf Deutsch geladen. Das /en/ verschwindet dann auch wieder aus der Domain!

Was passt da nicht?

Grüße und Danke

freshman17 ·

evtl. alle Tabellen von RealUrl leeren. Sicher ob der Fehler bei RealUrl liegt? Schon mal die Extension ausgeschaltet und es dann versucht?

typo3_hp ·

Hallo freshman!

Leider auch kein Erfolg.
Truncate auf die Tabellen, Cache leeren.

Extension (sr_language_menu) deinstalliert, dann war nur noch folgendes TS aktiv:

config.sys_language_mode = content_fallback ;
# SPRACHWAHL
# **********************
config (
  sys_language_mode = strict; 0
  config.sys_language_overlay = hideNonTranslated
  sys_language_uid = 1
  linkVars = L
  language = de
  locale_all = de_DE.UTF-8
)
page.config (
  language = de
  locale_all = de_DE.UTF-8
)
# English language, sys_language.uid = 1
  [globalVar = GP:L = 2]
config.sys_language_uid = 2
page.config.language = en
page.config.locale_all = en_EN.UTF-8
[global]

Danach truncate auf realurl-Tabellen, Caches gelöscht
Seite manuelle mittels domain.de/en/ aufgerufen (Wird auf Englisch geladen)

-> gleiches Ergebnis: d.h. nach einem Klick auf einen Menüeintrag wird diese Seite dann auf Deutsch anstatt auf Englisch geladen.

An was liegt das, stimmt etwas mit meinen TS nicht?

Danke und Grüße

typo3_hp ·

Das war ein gutes Argument!

config.tx_realurl_enable = 0 tut es auch nicht.

Es wird wenn ich auf die Flagge klicke der Languageparameter übergeben (und die Seite auch in Englisch geladen) [index.php?id=2&L=2], jedoch verlier ich auch wieder die Sprache sobald ich im Menü einen Eintrag anklicke!

Was ist es dann?

Grüße und Danke

typo3_hp ·

Hallo!

So sieht meine .htacces aus, was passt da nicht? Kann ja eigentlich nur noch hier dran liegen, oder?

#####
# 
# Example .htaccess file for TYPO3 CMS - for use with Apache Webserver
# 
# This file includes settings for the following configuration options:
# 
# - Compression via TYPO3
# - Settings for mod_rewrite (URL-Rewriting)
# - PHP optimisation
# - Miscellaneous
# 
# If you want to use it, you have to copy it to the root folder of your TYPO3 installation (if its
# not there already) and rename it to '.htaccess'. To make .htaccess files work, you might need to
# adjust the 'AllowOverride' directive in your Apache configuration file.
# 
# IMPORTANT: You may need to change this file depending on your TYPO3 installation!
#
# Lines starting with a # are treated as comment and ignored by the web server.
# 
# You should change every occurance of TYPO3root/ to the location where you have your website in.
# For example:
# If you have your website located at http://mysite.com/
# then your TYPO3root/ is just empty (remove 'TYPO3root/')
# If you have your website located at http://mysite.com/some/path/
# then your TYPO3root/ is some/path/ (search and replace)
# 
# You can also use this configuration in your httpd.conf, but then you have to modify some lines,
# see the comments (search for 'httpd.conf')
# 
# Questions about this file go to the matching Install mailing list, see
# http://typo3.org/documentation/mailing-lists/
# 
####


### Begin: Compression via TYPO3 ###

# Compressing resource files will save bandwidth and so improve loading speed especially for users
# with slower internet connections. TYPO3 can compress the .js and .css files for you.
# 1) Uncomment the following lines and
# 2) Set $TYPO3_CONF_VARS['BE']['compressionLevel'] = '9'

#<FilesMatch "\.js\.gzip$">
#	AddType "text/javascript" .gzip
#</FilesMatch>
#<FilesMatch "\.css\.gzip$">
#	AddType "text/css" .gzip
#</FilesMatch>
#AddEncoding gzip .gzip

### End: Compression via TYPO3 ###


### Begin: Browser caching of ressource files ###

# Enable long browser caching for JavaScript and CSS files.

# This affects Frontend and Backend and increases performance.
# You can also add other file extensions (like gif, png, jpg), if you want them to be longer cached, too.

<FilesMatch "\.(js|css)$">
  <IfModule mod_expires.c>
    ExpiresActive on
    ExpiresDefault "access plus 7 days"
  </IfModule>
  FileETag MTime Size
</FilesMatch>

### End: Browser caching of ressource files ###


### Begin: Settings for mod_rewrite ###

# You need rewriting, if you use a URL-Rewriting extension (RealURL, CoolUri, SimulateStatic).

<IfModule mod_rewrite.c>

# Enable URL rewriting
RewriteEngine On

# Change this path, if your TYPO3 installation is located in a subdirectory of the website root.
RewriteBase /

# Rule for versioned static files, configured through:
# - $TYPO3_CONF_VARS['BE']['versionNumberInFilename']
# - $TYPO3_CONF_VARS['FE']['versionNumberInFilename']
# IMPORTANT: This rule has to be the very first RewriteCond in order to work!
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L]

# Stop rewrite processing, if we are in the typo3/ directory.
# For httpd.conf, use this line instead of the next one:
# RewriteRule ^/TYPO3root/(typo3/|t3lib/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L]
RewriteRule ^(typo3/|t3lib/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L]

# Redirect http://example.com/typo3 to http://example.com/typo3/index_re.php and stop the rewrite processing.
# For httpd.conf, use this line instead of the next one:
# RewriteRule ^/TYPO3root/typo3$ /TYPO3root/typo3/index.php [L]
RewriteRule ^typo3$ typo3/index_re.php [L]

# If the file/symlink/directory does not exist => Redirect to index.php.
# For httpd.conf, you need to prefix each '%{REQUEST_FILENAME}' with '%{DOCUMENT_ROOT}'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

# Main URL rewriting.
# For httpd.conf, use this line instead of the next one:
# RewriteRule .* /TYPO3root/index.php [L]
RewriteRule .* index.php [L]

</IfModule>

### End: Settings for mod_rewrite ###


### Begin: PHP optimisation ###

# If you do not change the following settings, the default values will be used.

# TYPO3 works fine with register_globals turned off.
# This is highly recommended, if your web server has it turned on.
#php_flag register_globals off

### End: PHP optimisation ###



### Begin: Miscellaneous ###

# Make sure that directory listings are disabled.
#Options -Indexes

### End: Miscellaneous ###


# Add your own rules here.
# ...
AuthUserFile /files/typo3/.htpasswd
AuthGroupFile /dev/null
AuthName "Password Protected Area"
AuthType Basic

<limit GET POST>
require valid-user
</limit>
freshman17 ·

ist sowas erlaubt?

config (
...
)

Glaube eher nicht. Ersetzte folgenden Block:

config (
  sys_language_mode = strict; 0
  config.sys_language_overlay = hideNonTranslated
  sys_language_uid = 1
  linkVars = L
  language = de
  locale_all = de_DE.UTF-8
)
page.config (
  language = de
  locale_all = de_DE.UTF-8
)

durch:

config {
  doctype = xhtml_strict
  metaCharset = utf-8
  
  linkVars = L
  sys_language_mode = content_fallback;1,0
  sys_language_uid = 0
  language = de
  locale_all = de_DE.UTF-8
  htmlTag_langKey = de
  
  inlineStyle2TempFile = 0
  removeDefaultJS = 1
  pageTitleFirst = 1
  noPageTitle = 1
  xhtml_cleaning = all
  
  prefixLocalAnchors = all
  simulateStaticDocuments = 0
  tx_realurl_enable = 1

}

Und noch was, deine default-Sprache hat die ID 1? Ist doch standardmäßig auf 0

typo3_hp ·

Guten Morgen!

Passt nun alles - Dankeschön!

Hatte das Script von einem Tut. kopiert...!

Ja die ID muss doch in meinen Fall (Root: Website-Sprache Deutsch-> ID1 / Website-Sprache Englisch -> ID2) 1 sein, oder?

Grüße und DANKE!

typo3_hp ·

Guten Morgen!

Leider funktionieren bei mir die Thumbnails im BE nicht mehr, seid ich diese Real-URL-Config im Einsatz habe.
Die Thumbnails werden immer grau angezeigt! Bei einem Klick darauf wird das richtige Bild geöffnet!

Jemand eine Idee?

Danke und Grüße!

<?php
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
	'init' =>	array(
		'enableCHashCache'			=>	1,
		'appendMissingSlash'		=>	'ifNotFile',
		'enableUrlDecodeCache'		=>	1,
		'enableUrlEncodeCache'		=>	1,
		'respectSimulateStaticURLs'	=>	0,
		'postVarSet_failureMode'	=>	'',
	),
	'redirects_regex'	=>	array (),
	'preVars'			=>	array(
		array(
			'GETvar'	=>	'no_cache',
			'valueMap'	=>	array('no_cache' => 0,),
			'noMatch'	=>	'bypass',
		),
		array(
			'GETvar'		=>	'L',
			'valueDefault'	=>	'de',	// Standardsprache
			'valueMap'		=>	array(
				'de'		=>	'1',	// Sprach-Ids
				'en'		=>	'2',
			),
			'noMatch' => 'bypass',
		),
	),
	'pagePath'		=>	array(
		'type'				=>	'user',
		'userFunc'			=>	'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
		'spaceCharacter'	=>	'-',
		'languageGetVar'	=>	'L',
		'expireDays'		=>	7,
		'rootpage_id'		=>	1,	// <= hier die id der Root-Seite eintragen
		'firstHitPathCache' =>	1,
	),
	'postVarSets'	=>	array(
		'_DEFAULT'	=>	array(
			// news archive parameters
			'archive'	=>	array(
				array(
					'GETvar'	=>	'tx_ttnews[year]' ,
				),
				array(
					'GETvar'	=>	'tx_ttnews[month]' ,
					'valueMap'	=>	array(
						'january'	=>	'01',
						'february'	=>	'02',
						'march'		=>	'03',
						'april'		=>	'04',
						'may'		=>	'05',
						'june'		=>	'06',
						'july'		=>	'07',
						'august'	=>	'08',
						'september'	=>	'09',
						'october'	=>	'10',
						'november'	=>	'11',
						'december'	=>	'12',
					),
				),
			),
			//news pagebrowser
			'browse'	=>	array(
				array(
					'GETvar'	=>	'tx_ttnews[pointer]',
				),
			),
			// news categories
			'select_category'	=>	array (
				array(
					'GETvar'	=>	'tx_ttnews[cat]',
				),
			),
			// news articles and searchwords
			'article'	=>	array(
				array(
					'GETvar'		=>	'tx_ttnews[tt_news]',
					'lookUpTable'	=>	array(
						'table'					=>	'tt_news',
						'id_field'				=>	'uid',
						'alias_field'			=>	'title',
						'addWhereClause'		=>	' AND NOT deleted',
						'useUniqueCache'		=>	1,
						'useUniqueCache_conf'	=>	array(
							'strtolower'		=>	1,
							'spaceCharacter'	=>	'-',
						),
					),
				),
				array(
					'GETvar'		=>	'tx_ttnews[swords]',
				),
			),
		),
	),
	'fileName'	=>	array(
		'defaultToHTMLsuffixOnPrev'	=>	0, # bei 1 wird ".html" der URI hinzugefügt
		'index'						=>	array(
			'rss.xml'	=>	array(
				'keyValues'	=>	array(
					'type'	=>	100,
				),
			),
			'rss091.xml'	=>	array(
				'keyValues'	=>	array(
					'type'	=>	101,
				),
			),
			'rdf.xml'		=>	array(
				'keyValues'	=>	array(
					'type'	=>	102,
				),
			),
			'atom.xml'		=>	array(
				'keyValues'	=>	array(
					'type'	=> 103,
				),
			),
		),
	),
);
?>