Zum Inhalt springen

Sprachauswahl mit validen Links (RealURL)

Erstellt am 29. Mai 2012 · 2 Antworten · letzte Antwort am 30. Mai 2012

Tags: RealURL, Links, Frage

Goettert ·

Hallo Forum

RealURL funktioniert nun einwandfrei. Die URLs werden nun wie folgend korrekt angezeigt:
http://www.meinedomain.de/seite1.html
http://www.meinedomain.de/seite2.html
http://www.meinedomain.de/seite3.html

Verschiedene Sprachen sind auch erreichbar:
http://www.meinedomain.de/en/seite1.html
http://www.meinedomain.de/de/seite2.html
http://www.meinedomain.de/fr/seite3.html

Leider erscheinen die Links der Sprachauswahl noch ohne RealUrl:
http://www.meinedomain.de/index.php?id=3&L=0

Wie erreicht man nun die Sprachauswahl mit SEO freundlichen URLs?

tmp.SPRACHE = COA
tmp.SPRACHE{
  wrap = |
  10 = TEXT
  10 {
    field = uid
    dataWrap = <a href="index.php?id=|&L=0" class="language">GB</a> 
  }
  20 = TEXT
  20 {
    field = uid
    dataWrap = <a href="index.php?id=|&L=1" class="language">PT</a> 
  }
  30 = TEXT
  30 {
    field = uid
    dataWrap = <a href="index.php?id=|&L=2" class="language">DE</a> 
  }
  40 = TEXT
  40 {
    field = uid
    dataWrap = <a href="index.php?id=|&L=3" class="language">ES</a> 
  }
  50 = TEXT
  50 {
    field = uid
    dataWrap = <a href="index.php?id=|&L=4" class="language">FR</a> 
  }
}
Chrissli ·

Hallo Goettert,

das liegt daran, das nur Links in RealURLs gewandelt werden, die per Typo3 geparst wurden, am einfachsten
geht dies mit typolink:

tmp.SPRACHE = COA
tmp.SPRACHE{
  wrap = |
  10 = TEXT
  10 {
    value = GB
    stdWrap.typolink {     
      parameter.field = uid
      ATagParams = class="language"
      additionalParams = &L=0    
    }
  }
  20 < .10
  20.value = PT
  20.stdWrap.typolink.additionalParams = &L=1
  
  ...
  }
Goettert ·

Hallo Chrissli,

danke fuer die rasche Antwort - es funktioniert 😉

Hier noch mal das ganze Script zum nachvollziehen:

tmp.SPRACHE = COA
tmp.SPRACHE{
  wrap = |
  10 = TEXT
  10 {
    value = EN&nbsp;
    stdWrap.typolink {     
      parameter.field = uid
      ATagParams = class="language"
      additionalParams = &L=0    
    }
  }
  20 < .10
  20.value = PT&nbsp;
  20.stdWrap.typolink.additionalParams = &L=1
  
  30 < .10
  30.value = DE&nbsp;
  30.stdWrap.typolink.additionalParams = &L=2
  
  40 < .10
  40.value = ES&nbsp;
  40.stdWrap.typolink.additionalParams = &L=3
  
  50 < .10
  50.value = FR&nbsp;
  50.stdWrap.typolink.additionalParams = &L=4
}