FAL file title won't show in front-end with file collection "folder from Storage" - typo3

.
Hello
it's hard to explain ...
If you're using TYPO3 7.6 (w. fluid styled content) with the module "file links", you can upload single files, but you can also work with the "file collection" to organize your downloads in a sys-folder.
There're three different types of "file collections". 1. Static selection of files and 2. Folder from Storrage and 3. Select by category.
Now you've upload and edit your FAL-files (metadata, s. image below) with a new title and description. These fields e.g. {file.title} will show with fluid_styled_content (Uploads.html), if you're using a single download or a file collection static selection of files, but not, if you're using Folder from storrage! The title won't show, you only see the {file.name} ..?
I'm using the standard Uploads.htmlform FSC with an extra condition.
Test <f:debug>{file.title}</f:debug>, see below. There's no Title from files via "folder from storrage".
...
<f:if condition="{file.title}">
<f:then>
{file.title}
</f:then>
<f:else>
{file.name}
</f:else>
</f:if>
...
Is it a bug or a feature for TYPO3 8?
I hope my pictures can explain this behavior better.

There was a TYPO3 Core Bug, but now it's fixed (TYPO3 7.6.15) - update Core and Fluid Styled Content-Template Uploads.html
Line 26
<a href="{file.publicUrl}"{f:if(condition:data.target,then:' target="{data.target}"')}>
<span class="ce-uploads-fileName">
<f:if condition="{file.properties.title}">
<f:then>
{file.properties.title}
</f:then>
<f:else>
{file.name}
</f:else>
</f:if>
</span>
</a>
Thanks to the TYPO3 Core Development Team! See revision.

Related

In fluid, how do I use a widget only if it exists?

I am making a sitepackage to be compatible with TYPO3 9 & 10. However it is using the news extension which changes the way pagination is done.
Is there a way in fluid to do something like:
<f:if condition="n:widget.paginate">
<f:then>
Use n:widget.paginate
</f:then>
<f:else>
Use newer paginate method
</f:else>
</f:if>
By default there is no such condition.
You might define a view helper to check the installation of an extension and the extension version. Or you use a view helper to check the existence of a class representing the view helper.
In ext:vhs you find a view helper to check if an extension is loaded and a try view helper to catch a rendering error.

TYPO3 - How to check if a news article has a certain parent category with fluid

How can I check that a news article has a certain parent category in m'y Fluid template?
Maybe this can help :
<f:for each="{newsItem.categories}" as="category">
<f:if condition="{category.parent.uid} == theCatIdYouAreSearchingFor">
do your stuff here...
</f:if>
</f:for>

Backend Preview - get Image or IRRE data in Fluidtemplate

I use a Fluid Template for the backend: mod.web_layout.tt_content.preview
Is it possible to get images from FAL or data from an IRRE element in this template?
For the frontend there is the TYPO3\CMS\Frontend\DataProcessing\FilesProcessor for example. Could that also be used in backend?
You would need a custom VH (IMO VHS also provides those) which gets you the data. It is not possible by default with the core.
I ended up lately to use the hook PageLayoutViewDrawItem in TYPO3\CMS\Backend\View\PageLayoutView for doing that. That was the easiest way.
As Georg Ringer has already mentioned, you can render preview images in Fluid Preview Templates with the VHS ViewHelper v:resource.record.fal
https://viewhelpers.fluidtypo3.org/fluidtypo3/vhs/5.0.1/Resource/Record/Fal.html
As record I must pass the argument _all because I have no other record available.
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers"
data-namespace-typo3-fluid="true">
<f:if condition="{assets}">
<v:content.resources.fal field="assets" as="images" record="{_all}">
<f:for each="{images}" as="image">
<f:if condition="{image}">
<f:image src="{image.id}" treatIdAsReference="1" width="100"/>
</f:if>
</f:for>
</v:content.resources.fal>
</f:if>
</html>

TYPO3 Extension News (tx_news) show & link tags at detail page

I'm using TYPO3 7.6.2with the extension news(4.1.0) ... I'm showing the news tags at my detail page (own template : Resources/Private/Extensions/News/Templates/News/Detail.html).
At list view it's no problem to show & hyperlink a list of tags.
But not at detail view.I can show them but how can I link the seperate tags as well?
<f:for each="{newsItem.tags}" as="tag">
<f:link.page title="{tag.title}" pageUid="{tag.uid}" additionalParams="{tx_news_pi1:{overwriteDemand:{tags: tag}}}">
{tag.title}
</f:link.page>
</f:for>
The uidis wrong, see screenshot. How can I make a link from detail- to tag-list-view with the corresponding tag?
It just works with a page ID, which contains a news list:
<f:link.page title="{tag.title}" pageUid="{22}" additionalParams="{tx_news_pi1:{overwriteDemand:{tags: tag}}}">
You use the uid as a page uid, thus gives you the wrong link.
You need to link to a page where you have a list of the news items with a certain tag :
<f:link.page title="{tag.title}" pageUid="{settings.mynewssettings.pageidoftaglist}" additionalParams="{tx_news_pi1:{overwriteDemand:{tags: tag}}}">

Prevent Typo3 broken image url error

In my Typo3 extension I'm showing a lot of images with fluid, an list view of products. Only if for some reason one image is missing on my server, Typo3 generates an full screen error so the complete website is then not working.
I my opinion there are three way to prevent it:
1) Configure Typo3 so it is ignoring broken image url's. Does anyone know if this is possible?
2) Let Fluid check if the image exists before it is generated. Don't know if this is possible?
3) Use the controller to check if the image exists before it is send to the frond-end. Only due to the manny images it uses a lot of processing.
I prefer the use of the media exists viewhelper from the VHS Viewhelper package. After installing and activating the extension it should look like this screenshot in your TYPO3 extension manager.
This example iterates through a array of products, that have a public picture property holding the filename of it's picture.
{namespace v=FluidTYPO3\Vhs\ViewHelpers}
<f:for each="{products}" as="product">
<v:media.exists file="fileadmin/products/{product.picture}">
<f:then>
<f:image src="fileadmin/products/{product.picture}" />
</f:then>
<f:else>
<f:image src="fileadmin/noImageFound.jpg" />
</f:else>
</v:media.exists>
</f:for>