TYPO3 v11: parse <link> tags - typo3

I'm currently upgrading a TYPO3 v9 to v11. There I use the table content element in combination with tags. E.g. something like this:
Some Text with an <link https://domain.tld>external link</link>
In TYPO3 v9 I used this to get real links in the table:
<f:format.html parseFuncTSPath="lib.parseFunc">{cell}</f:format.html>
But in v11 the link is not parsed correctly. Output is:
<link https: domain.tld>external link
So the double slash and the closing </link> are gone.
I tried to use a custom parseFunc where I disabled htmlSanitize. Then the <link> tag stays intact, but isn't parsed at all.
Any ideas how I can get <link> work again? Or is there any other way to use links in the table content element?

<link> is old Syntax and migrated already in v8. However, this was still partly able in v9.
See: https://docs.typo3.org/c/typo3/cms-core/9.5/en-us/Changelog/9.0/Deprecation-83252-Link-tagSyntaxProcesssing.html?highlight=link
You should properly migrate your content to the new Syntax before upgrade. In v9 the corresponding UpgradeWizard should still be there, in v11 not.
From core side you cannot get it working again as core dropped this Syntax. Better migrate your content properly.

Related

How to get rendered links of a HTML element in TYPO3 7.6

IN TYPO3 versions before 7.6 it was possible to render links inside the content element HTML by using the TypoScript
tt_content.html.parseFunc.tags.link < lib.parseFunc.tags.link
This does not work anymore since 7.6. How can it be solved?
If you use fluid_styled_content, override the HTML.html and want to use forms and have the Typo3 link tags <link>text</link> converted to html links, you will have to use this (at least this worked for me, both custom html forms were working and links were converted):
<f:format.htmlentitiesDecode>
<f:format.html parseFuncTSPath="lib.parseFunc">
{data.bodytext}
</f:format.html>
</f:format.htmlentitiesDecode>
There are a couple of possible solutions for this question.
1.) Use fluid_styled_content.
I guess that now fluid_styled_content instead of css_styled_content is used. Therefore the used TypoScript does not work anymore. A valid solution would be to switch back to css_styled_content. However that is the old ancient way and for newer projects you shouldn't do this.
2.) Override the template of fluid_styled_content.
If you open the template of fluid_styled_content and the HTML element, found at typo3/sysext/fluid_styled_content/Resources/Private/Templates/Html.html you will see
<f:format.raw>{data.bodytext}</f:format.raw>
this must be changed to
<f:format.html>{data.bodytext}</f:format.html>
Overriding is described in the docs, see https://docs.typo3.org/typo3cms/extensions/fluid_styled_content/7.6/Configuration/OverridingFluidTemplates/Index.html

TYPO3 FAL changed image not available in translation

In TYPO3 7.6, when I exchange an image in the base language I am not able to add this image in an already existing translation record.
For example: I added image pic1.jpg in English (L=0), on translating to German (L=1) pic1.jpg is available for activation. Later I remove pic1.jpg and add pic2.jpg, probably clipping or otherwise modify the relation so I have data that I want to preserve.
I'm able to delete the German translation record and add a new translation in both list view and page->languages:"Add Translation" with new image(s) and all its modifications preserved, but that is a work-around loosing all translated fields in the process.
If my memory doesn't fail me, there was a dimmed FAL record appearing in the translation media tab once it was added in the base language back in former versions of TYPO3 (6.1).
Bug? Or am I missing something?
It's a TYPO3 v7.6 core bug which exists since 2014 but it was never fixed. See bug report: https://forge.typo3.org/issues/57272
There are multiple ways to solve this issue. I had this problem too and for me it only worked with the first solution.
1. Create a ViewHelper
It's a solution from Kai Tallafus who shared his ViewHelper in the comments of the bug report 57272 (see link to bug report above).
ViewHelper: https://forge.typo3.org/attachments/download/32333/FalTranslationFixViewHelper.php
Usage of the ViewHelper in Fluid Template:
<util:falTranslationFix record="{record}" tableName="tx_myext_domain_model_foo" relationFieldName="files" as="files">
<f:if condition="{files -> f:count()} > 0">
<f:for each="{files}" as="file">
{file.properties.title}
</f:for>
</f:if>
</util:falTranslationFix>
2. Install an Extension
I found two extensions who probably will fix the bug. I recommend the first one but it doesn't work for me but maybe it will for you.
repair_translation
faltranslation (only available on bitbucket -> bitbucket.org/t3easy_de/faltranslation/src)
3. Enable sys_language_uid field for the FAL Media
There is a workaround for the translation of the FAL Media in which you enable the sys_language_uid field. When enabled the enduser can select the language for the media element. This also not worked for me but I know from a friend that in one of his project it worked. Manual (in german): www.npostnik.de/typo3/workaround-fuer-uebersetztungen-der-datensaetze-mit-fal-media/
4. Update to TYPO3 v8 LTS
When you're working on a project which could be updated to the new Version, you should consider to make an update. The Bug is fixed in the TYPO3 v8 LTS.
The viewhelper won't work for the field media in tablep-pair pages/page_labnguage_overlay. (TYPO3 8.7)
You have to seperate your translateted parts in the fluid-template. The where-clause in the query should check for 'pid' instead of 'uid'. And you have to check for a relavant entry in the media-field of the $rawRecord.

Tableless images in TYPO3 4.7?

I am stuck updating a site on TYPO3 4.7. Upgrading is not an option.
All the content elements that use images are formatted with tables and spacer.gifs, is there any way to make it use divs and css instead?
If css_styled_content is correctly installed, and you'Ve included the static template in your main template, this is indeed not the expected behaviour.
Did you flush all output caches? If so, check the value of the typoscript setting at tt_content.image.20.renderMethod and tt_content.textpic.20.renderMethod. They may be set to "table", and should be one of "figure", "ul" or "div".
However, TYPO3 4.7 is out of it's LTS phase. You need to update as soon as possible.
4.7 is outdated and there is no such option there, sorry

Video relations not working for tx_news on TYPO3 7.6

I have been developing a site with TYPO3 6.2.15 and using the extension tx_news to show, well, news. Setting "Use FAL relations instead of news media elements" to "FAL + Multimedia" I could create relations with YouTube files, and they were shown in the frontend, both detail and list (if they have "Show in preview views" checked) page. The problem now is that after updating to TYPO3 7.6.2 they don't show up anymore. Gone, they appear in the backend if you edit a news record, but not in the frontend.
I know, in the documentation it says that the integration of audio and video is still to be done:
https://docs.typo3.org/typo3cms/extensions/news/stable/singlehtml/#video-audio-file
but it worked with TYPO3 6.2, so I assume it should work too with 7.6 too. The tx_news version I am using is 4.0.0.
Has anybody had the same issue and knows how to solve it?
The CE media element was removed in TYPO3 7LTS. In order to keep the old behaviour there is a system extension "mediace". I would install and configure it (f.e. add the static typoscript).
The custom media rendering has been removed in the master (upcoming 5.0.0) in favor of FAL. The best solution is to use
<f:for each="{newsItem.falMedia}" as="mediaElement">
<f:media file="{mediaElement}" class="img-responsive" />
</:for>
as this uses the renderers of FAL which can be of course also be extended by custom solutions.

jQuery Tmpl removes TR tag content when not wrapped by TABLE tag

Upon migrating my old web interface with extensive use of jQuery Tmpl, some of my templates have ceased to work. Further investigation shows that the templates not working are the ones starting and ending with TR tags (i.e. table rows getting appended to an existing table). The source text just gets removed by the jQuery Tmpl script! If I use the TR tags in a broader context like wrapped in a table etc everything works just fine, but as soon as they are used in an isolated template, they get wiped out.
working example:
<script id="workingTemplate" type="text/x-jQuery-tmpl" >
<table>
<tr><td>this works</td></tr>
</table>
</script>
not working example:
<script id="notWorkingTemplate" type="text/x-jQuery-tmpl" >
<tr><td>this does not work</td></tr>
</script>
The first example renders the full HTML code when checking with Firebug, the latter renders an empty SCRIPT tag.
The difference between the old and the new web interface that could in any way be related to the templating is a change from jQuery 1.5.2 to 1.8.2. I haven't tried running anything below 1.7.2 since this is where the .on() function got added, and the new framework has an extensive use of this method.
Are there any workarounds for this problems except the most obvious (= changing templating framework to something still maintained)?
EDIT:
When loading the template from a string, the content stays intact,
$.template( "tableRowTemplate",'<tr><td>this works</td></tr>');
$.tmpl("tableRowTemplate", data).appendTo('TABLE#mytable TBODY');
but is unfortunately no good for me since my templates are a tad more complicated than the examples (server side dynamics etc...). It does give some hints though. Obviously, it is the initialization of jQuery Tmpl that removes the content if it does not comply with something to me unknown. Maybe jQuery.fn.domManip?