Project

General

Profile

Actions

Bug #67085

closed

language menu uses incorrect active state

Added by Stefan M. almost 9 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
-
Start date:
2015-05-21
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

I wanted to create the hreflang tags for a website with 3 different languages: de-DE (default language), de-AT, de-CH.
de-AT and de-CH shall show the complete content of de-DE if there is no translation of the page. So I set hidePagesIfNotTranslatedByDefault to false.

I used this TypoScript:

page.headerData.40 = HMENU
page.headerData.40 {        
  special = language
  special.value = 0,1,2

  1 = TMENU
  1 {
    NO = 1
    NO {
      doNotLinkIt = 1

      stdWrap.cObject = TEXT
      stdWrap.cObject.value = de-DE || de-AT || de-CH

      linkWrap = <link rel="alternate" hreflang="|
      after.cObject = TEXT
      after.cObject {
        stdWrap {
          wrap = " href="|" />
          typolink {
            parameter.data = page:uid
            additionalParams =  &L=0 || &L=1 || &L=2
            returnLast = url
            forceAbsoluteUrl = 1
            addQueryString = 1
          }
        }
      }
    }
    ACT = 1
    ACT.doNotShowLink = 1
  }
}

Now the problem:
If I'm on the e.g. de-CH page without any translation, de-DE is the ACT item.
I checked the language id with GP:L and it is set to 2. So IMHO de-CH should be ACT and not de-DE.

I hope you understand what I mean.

Actions #1

Updated by Stefan M. almost 9 years ago

Damn.. I forgot to set a good issue title.. :)

Actions #2

Updated by Mathias Schreiber almost 9 years ago

  • Subject changed from language menu to language menu uses incorrect active state
Actions #3

Updated by Frederic Gaus almost 9 years ago

I tested your Typoscript. For me everything works perfectly well. I am unable to reproduce.

Nevertheless in the first moment I thought I was able to reproduce the issue. But then I noticed that my language configuration was not complete. Do you have a complete language configuration similar to this one…


config {
  uniqueLinkVars = 1
  linkVars := addToList(L(1-3),print)
  sys_language_uid = 0
  sys_language_overlay = 1
  sys_language_overlay = hideNonTranslated
  sys_language_mode = content_fallback
  #sys_language_mode = strict
  language = de
  locale_all = de_DE.utf8
  htmlTag_langKey = de
}

## AT
[globalVar = GP:L = 1]
config {
  sys_language_uid = 1
  language = at
  locale_all = de_AT.utf8
  htmlTag_langKey = at
}
[global]

## CH
[globalVar = GP:L = 2]
config {
  sys_language_uid = 2
  language = ch
  locale_all  = de_CH.utf8
  htmlTag_langKey = ch
}
[global]

Actions #4

Updated by Frederic Gaus almost 9 years ago

  • Status changed from New to Needs Feedback
Actions #5

Updated by Stefan M. almost 9 years ago

My configuration looks similar except:

sys_language_overlay = 1
sys_language_overlay = hideNonTranslated
sys_language_mode = content_fallback

So I added those lines of Typoscript.

Now the active state seems to stop working on CH and AT.
On DE the hreflang for DE was removed. On CH and AT all 3 hreflang are shown.

Actions #6

Updated by Riccardo De Contardi over 8 years ago

Stefan, is this reproducible on the latest 6.2.15 or the latest 7 master?

Actions #7

Updated by Stefan M. over 8 years ago

On 6.2.15 it's still reproducable. On 7 I couldn't test it yet.

Actions #8

Updated by Alexander Opitz about 8 years ago

  • Status changed from Needs Feedback to New
  • Target version set to next-patchlevel
Actions #9

Updated by Riccardo De Contardi over 7 years ago

  • Category set to TypoScript
Actions #10

Updated by Benni Mack over 5 years ago

  • Status changed from New to Needs Feedback

We implemented href-lang inside the new EXT:seo extension in v9, and also overcame the issue with the proper language configuration via Site Handling. Can you check if this issue still exists? Otherwise we'll close the ticket in a few weeks.

Actions #11

Updated by Riccardo De Contardi over 5 years ago

  • Status changed from Needs Feedback to Closed
  • Target version deleted (next-patchlevel)

No feedback since the last 90 days => closing this issue.

If you think that this is the wrong decision or experience the issue again and have more information about how to reproduce your problem, please reopen it or open a new issue with a reference to this one.

Thank you and best regards

Actions

Also available in: Atom PDF