fluid

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

TYPO3: Reading the values of a TCA 'type' => 'check' (bitmask)

你离开我真会死。 提交于 2019-12-25 01:45:36
问题 I need to show a selection of days in an event in the frontend: in my TCA I set the field like this: 'days' => [ 'exclude' => true, 'label' => 'choose weekdays', 'config' => [ 'type' => 'check', 'eval' => 'required,unique', 'items' => [ ['monday',''], ['thuesday',''], ['wednesday',''], ['thursday',''], ['friday',''], ['saturday',''], ['sunday',''], ], 'cols' => 'inline', ], ], That stores an integer in the db, but now I have to display the selected days in a fluid template in the frontend.

Is it possible to write a specific query in typoscript

旧城冷巷雨未停 提交于 2019-12-24 23:05:25
问题 my question may seem trivial, sorry if it is! I am currently learning typo3 and typoscript. I want to create a template with a dynamic background image. This image is stored in a directory. I would like to get the image name from the table tt_content. However, the way this works confuses me a bit and i don't know if my take on it is the right one. The code looks like this: 20 = CONTENT 20.table = tt_content 20.select{ where = pid = 79 } 20.headerImagePath = COA 20.headerImagePath { 10 = TEXT

“Could not analyse class: maybe not loaded or no autoloader?”

邮差的信 提交于 2019-12-24 07:06:49
问题 I created (my first) extension with one viewhelper. Oops, an error occurred! Could not analyse class:My\Mlv\ViewHelpers\Format\ReplacenewlinesViewHelper maybe not loaded or no autoloader? In use (with news): {namespace m=My\Mlv\ViewHelpers} {newsItem.bodytext -> m:format.replacenewlines()} Directory tree of extension: typo3conf/ext/mlv ext_emconf.php (copied from another ext) /Classes /ViewHelpers /Format ReplaceNewLinesViewHelper.php ReplaceNewLinesViewHelper.php: <?php namespace My\Mlv

What is the difference between render() and renderStatic() and what should be used when writing a ViewHelper in TYPO3

让人想犯罪 __ 提交于 2019-12-23 23:23:03
问题 There are several examples for writing a custom ViewHelper and different ways to do things. I have seen examples with render() and with renderStatic (for example in Developing a Custom ViewHelper). In 24 Fluid Tips there is an explanation, but I don't understand it and it does not make it clear for me why there are 2 functions and what should be used where. Breaking changes (Render method arguments on ViewHelpers deprecated) and fragmented information in various places makes it difficult to

How do I get dynamically fluid images depending on browser window aspect ratio?

别等时光非礼了梦想. 提交于 2019-12-23 19:09:39
问题 This might not be a simple question, but I try my best. I have this example site: http://lotvonen.tumblr.com/ I have a little piece of javascript that automatically calculates the height of the inner browser window and sets that number as image wrapper div's height. Height of the image inside the wrapper is 100% of the wrapper, so that I get nice, full screen images on all normal screen sizes. This works wonderfully on screens that are more wide than tall (desktops, laptops, etc). But! With

scale div to background image size

泄露秘密 提交于 2019-12-23 04:27:08
问题 I have an image that I need to put divs on top of for links. I did this fine when I initially created the website, but now I am tasked with making it responsive, so I can no longer use -top and left values to position the overlay divs because they don't move with the image. Trying to put the image as a background image so that the position of the overlays can be set and contained within the parent container. I have tried using the background size property (cover, contain, 100%), but they will

TYPO3 extbase - fluid variable to jquery

时间秒杀一切 提交于 2019-12-22 11:24:51
问题 How could one pass a fluid variable from the controller to jQuery or JavaScript? Inside my controller: public function tabs () { $this->view->assign('tab', 1); } Inside fluid I'd use the variable as {tab} But how can I pass to JavaScript? Any help would be appreciated... 回答1: JS in fluid templates behaviour is ... terrible in most cases, if your JS code contains any curly brackets you need to include external script instead placing the script in the view. The reason is that Fluid thinks, that

Simple div with header,footer and body

我与影子孤独终老i 提交于 2019-12-21 20:43:56
问题 I need a simple div with header,footer and body content. The header and footer needs to be fixed and the height of div should be 250px or max 500px and its width is 500px And my body content should be fluid so that it should extend the content. Header and footer needs to be 40px. And I need a horizontal line after header and above footer. I have done it but I am unable to set its footer as I am going nuts with the alignment. Can anyone suggest me with this: CSS: mainbody { position:absolute;

How can I get the category object in Fluid of Typo3 Content Element Pictures?

陌路散爱 提交于 2019-12-21 20:35:21
问题 after a long time of Google, I can get the categories of FAL Objects in Typo3 7.6 Fluid. But I can only return a String. I want to get an object like {data}. What I do: TypoScript lib.category = CONTENT lib.category { table=sys_category wrap=| select { pidInList = root,0,1 recursive = 99 max=10 selectFields=sys_category.title,sys_category.uid join = sys_category_record_mm on sys_category_record_mm.uid_local = sys_category.uid join sys_file_metadata on sys_file_metadata.uid = sys_category