typo3-9.x

Render image in fluid template if it exists?

落花浮王杯 提交于 2019-12-25 01:53:04
问题 How can I use f:if to see if an image exists before trying to render it? I have tried the following without success: {f:if(condition: page.files.0, then: ' style="background-image:url({f:uri.image(image:page.files.0, width:300c, height:200c)}"')} <f:if condition="{page.files.0}"> style="background-image:url({f:uri.image(image:page.files.0, width:300c, height:200c)}" </f:if> It works if there is an image but breaks the element when there is not. 回答1: When I want to add an image url to the

Multiple controllers in an extension

强颜欢笑 提交于 2019-12-24 19:15:24
问题 Is it actually possible to write an extension with multiple controllers that will work automatically on all sites? What i want is an extension that would call controller A when site A is opened, controller B when site B is opened and so on. I saw here https://docs.typo3.org/typo3cms/extensions/news/ that multiple controllers is possible with FlexForms and switchableControllerActions . The thing is, when i add the plugin to the site, i have to specify which controller should work for this site

How to set up Variants for Entry Points of additional languages in TYPO3

跟風遠走 提交于 2019-12-24 06:10:34
问题 The final domains of the project will be: www.domain.com (english, main language, L=0) www.domain.de (german, L=1) The development/preview domains are dev.domain.com dev.domain.de It is possible to create a Variant for the main "Entry Point" in tab "General" of the Site Configuration: Base: https://dev.domain.com/ Condition: applicationContext == "Development" But how can I set up a variant for the second language (german)? 回答1: as long as you need no other language specific configuration,

Exception on executing ext:news upgrade wizard for updating path_segment in TYPO3 9

爷,独闯天下 提交于 2019-12-13 20:17:20
问题 After upgrading to TYPO3 9, some of the tx_news_domain_model_news path_segment fields were empty, so I marked Upgrade Wizard "Updates slug field "path_segment" of EXT:news records" of news extension" as undone and tried to execute it. This throws an exception . Makes no difference if executed via backend or on command line, though the command line shows a success message before the error:: typo3-cli upgrade:run newsSlug Output: In UpgradeWizardsService.php line 466: No valid wizard identifier

How to remove anchors in a multilang TYPO3 9.5.5

别说谁变了你拦得住时间么 提交于 2019-12-13 04:11:45
问题 I tried in my typoscript setup as this stack overflow topic describes: tt_content.stdWrap.dataWrap > tt_content.stdWrap.prepend.dataWrap > tt_content.stdWrap.innerWrap.cObject.66.10 > But nothing works in my TYPO3 9.5.5 multilang. In my language id=0 I do not have anchors (even without the tt_content.stdWrap). In my language id=1 I cannot get rid of it. Do you got a solution or some helpful hint? 回答1: if you use FSC: in the layoutfile ( ext:fluid_styled_content/Resources/Private/Layouts

TYPO3 RouteEnhancer with custom ValueMapper

[亡魂溺海] 提交于 2019-12-13 03:49:22
问题 I'm currenty trying to implement a custom RouteEnhancer. Is it just me, or is the documentation horribly incomplete again? I haven't been able to find any information about custom enhancers in TYPO3 other than a meager paragraph in the changelog entry, where can I get more information about these? I can't event find them in the API documentation. The relevant part of my domain model in my extension is Termin and Veranstaltung . Theres a n to 1 relation type from termin->veranstaltung . My

TypoScript condition based on language - TYPO3 version 9

纵然是瞬间 提交于 2019-12-11 19:47:55
问题 I'm currently upgrading a site from version 7 to version 9. I have a small TypoScript object that shows different content depending on the page language selected: lib.myTSO = TEXT lib.myTSO.value ( <p>Hello World</p> ) [globalVar = GP:L =1] lib.myTSO = TEXT lib.myTSO.value ( <p>Hello World in a different language</p> ) [global] This worked, in version 7 & 8 but no longer appears to be working in version 9. I assume its the way in which I'm calling the language variable? Thanks again, 回答1:

TYPO3 Best practice assigning cObject data to view since getContentObject() is depricated

邮差的信 提交于 2019-12-11 17:19:53
问题 I was wondering how this is solved in modern extensions, but could not figure it out. Most of them just magical using e.g. {data.uid} inside their views without any $view->assign('data',...) In my old actions I had used something like this: public function myAction() { $data = $this->configurationManager->getContentObject()->data; $this->view->assign('data', $data); } Since getContentObject() is marked as deprecated in v8, it should be replaced with getContentObjectRenderer() , but the

RouteEnhancer with aspects throws InvalidParameterException

荒凉一梦 提交于 2019-12-11 10:59:10
问题 I used the example verbatim from the Changelog: The only thing I changed was the limitToPages. routeEnhancers: NewsPlugin: type: Extbase limitToPages: [82] extension: News plugin: Pi1 routes: - { routePath: '/{news_title}', _controller: 'News::detail', _arguments: {'news_title': 'news'} } defaultController: 'News::detail' aspects: news_title: type: PersistedAliasMapper tableName: 'tx_news_domain_model_news' routeFieldName: 'path_segment' routeValuePrefix: '/' This throws an exception in 9.5.4

TYPO3 9.5 URL Routing with URL Segment is not working

我的梦境 提交于 2019-12-08 00:11:49
问题 I am not very experienced in Typo3 so I hope my question/problem would be a quite simple one. I use a Typo3 9.5.0 LTS instanz on Ubuntu with Apache and MySQL. Problem is that URLS routing (https://typo3.org/community/teams/typo3-development/initiatives/routing/) is not working. I created a Site Configuration for relevant Pagetree. Within the pages in Backend the URL segment is visible and changeable. This URL segment is also taken correct by menu entries and by the sitemap. But I could not