Project

General

Profile

Actions

Bug #64339

closed

multilangual site and image from resources

Added by Tomasz Krawczyk about 9 years ago. Updated over 7 years ago.

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

0%

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

Description

Hi!

I have site with 4 languages and 7 pages on 1 level (root is 0). On all languages I have the same banner for page. So, on /kontakt/ (PL) is the same image as /contact/ (EN) and so on. So I added image only to page resources.

In TYPO3 6.1.12 that TS was working on all languages:


#
# Page Banner
#
lib.pageBanner = COA
lib.pageBanner {

    cache.key = pageBanner_{page:uid}_{TSFE:sys_language_uid}
    cache.key.insertData = 1

    10 = FILES
    10 {
        references {
            #data =  levelmedia: -1,slide
            table = pages
            uid.data = leveluid: -1, slide
            fieldName = media
        }
        renderObj = IMAGE
        renderObj {
            file.import.data = file:current:publicUrl
            file.maxH = 161
            file.maxW = 880
            #file.import.override.field = media
            file.treatIdAsReference = 1
            titleText.data = page:title
            altText.data = page:title
        }
    }
}

After upgrade to 6.2.9 it is not working. My friend told me that I should add images to resources of all alternative language records. I think it should work as in 6.1 or it should be some TypoScript instruction to achieve this.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #63353: Media Relation from translated page properties in a workspaceClosed2014-11-26

Actions
Actions #1

Updated by Markus Klein about 9 years ago

This snippets works for us

page.cssInline.10 = FILES
page.cssInline.10 {
  references {
    table = pages
    data = levelmedia:-1, slide
  }
  maxItems = 1

  renderObj = TEXT
  renderObj {
    typolink.parameter.cObject = IMG_RESOURCE
    typolink.parameter.cObject {
      file.import.data = file:current:uid
      file.treatIdAsReference = 1
      stdWrap.required = 1
    }
    typolink.returnLast = url
    wrap = #teaser { background-image: url("|") }
  }
}

Actions #2

Updated by Riccardo De Contardi over 8 years ago

  • Status changed from New to Needs Feedback

Tomasz, I am sorry for this late answer.

Could you tell us if the snippet from Markus Klein is good for you and solves your problem? Thank you.

Actions #3

Updated by Tomasz Krawczyk over 8 years ago

No. It is not working. Using Markus example I changed TS to:

#
# Page Banner
#
lib.pageBanner = COA
lib.pageBanner {
    cache.key = pageBanner_{page:uid}_{TSFE:sys_language_uid}
    cache.key.insertData = 1

    10 = FILES
    10 {

        references {
            table = pages
            data = levelmedia:-1, slide
        }
        maxItems = 1

        renderObj = TEXT
        renderObj {
            typolink.parameter.cObject = IMG_RESOURCE
            typolink.parameter.cObject {
                file.import.data = file:current:uid
                file.treatIdAsReference = 1
                stdWrap.required = 1
            }
            typolink.returnLast = url
            wrap = #teaser { background-image: url("|") }
        }

    }
}

The text:

#teaser { background-image: url("/fileadmin/templates/page/Layouts/images/pages/oferta.jpg") }

is showing only on the main language.

If Markus's example is workint to him then probably I have a bug in my configuration.

This is multilanguage config of this site. If you know what is wrong then please tell me. But if you don't know then please close this bug report.

# -----------------------------------------------------------
# Multilanguage
# -----------------------------------------------------------
config {
    linkVars = L
    uniqueLinkVars = 1
    sys_language_mode = content_fallback
    sys_language_overlay = hideNonTranslated
}

# Polski
config {
    sys_language_uid = 0
    language = pl
    locale_all = pl_PL
    htmlTag_langKey = pl
}
[browser = msie]
config.htmlTag_setParams = xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xml:lang="pl" 
[global]

# Angielski
[globalVar = GP:L = 1]
config {
    sys_language_uid = 1
    language = en
    locale_all = en_EN
    htmlTag_langKey = en
}
[globalVar = GP:L = 1] && [browser = msie]
config.htmlTag_setParams = xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xml:lang="en" 
[global]

# Niemiecki
[globalVar = GP:L = 2]
config {
    sys_language_uid = 2
    language = de
    locale_all = de_DE
    htmlTag_langKey = de
}
[globalVar = GP:L = 2] && [browser = msie]
config.htmlTag_setParams = xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xml:lang="de" 
[global]

# Włoski
[globalVar = GP:L = 3]
config {
    sys_language_uid = 3
    language = it
    locale_all = it_IT
    htmlTag_langKey = it
}
[globalVar = GP:L = 3] && [browser = msie]
config.htmlTag_setParams = xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xml:lang="it" 
[global]
Actions #4

Updated by Markus Klein over 8 years ago

Our language setup is

config {
  linkVars = L(0-1)
  sys_language_mode = content_fallback; 0
  sys_language_overlay = 1
}

So maybe the overlay makes the difference.

But please also check what your $GLOBALS['TYPO3_CONF_VARS']['FE']['pageOverlayFields'] configuration contains. There should be the "media" field in this list.

Hint: You should update your TS for "linkVars" to limit the valid language uids! (Security measure)

Actions #5

Updated by Tomasz Krawczyk over 8 years ago

Indeed I had 'media' on the $GLOBALS['TYPO3_CONF_VARS']['FE']['pageOverlayFields']. Actually I have never touched this setting before. After I removed 'media' from the pageOverlayFields list my TS started working.

Thanks a lot!

Actions #6

Updated by Markus Klein over 8 years ago

Funny... because it's there by default, and actually should work when it's there. Very strange. Would have to debug that. Maybe you can test your setup with 7.4+ so we know whether this is still an issue there?

Actions #7

Updated by Oliver Hader over 8 years ago

Seems to be strongly related to #63353

Actions #8

Updated by Alexander Opitz about 8 years ago

What is the state of this issue?

Actions #9

Updated by Tomasz Krawczyk about 8 years ago

That website will not be upgraded from 6.2. So, the bugreport may be closed.

Actions #10

Updated by Markus Klein about 8 years ago

  • Status changed from Needs Feedback to Closed
Actions #11

Updated by Joe Jones over 7 years ago

Hallo,

I want to give feedback for this issue on 8.2.1. I had the same problem. Media ressource from the page property wwas not shown in the alternative language. I removed "media" from "pageOverlayFields" an YES it works. If that ist NOT the expected behavior, than you should open this issue again

config {
linkVars = L(0-1)
sys_language_mode = content_fallback; 0
sys_language_overlay = 1
}

Installtool:

[FE][pageOverlayFields] = uid,doktype,title,subtitle,nav_title,keywords,description,abstract,author,author_email,url,urltype,shortcut,shortcut_mode,

Related: [[https://forge.typo3.org/issues/77541]] course if media has no fallback to standard media, it should be possible to edit the ressource image in alternative language of the page property.

Actions

Also available in: Atom PDF