powermail: rendered links in HTML element in typo3 9 - typo3

Default behaviour of Typo3 is that Typo3-Links are not rendered in a HTML-element. There is a workaround, see here: How to get rendered links of a HTML element in TYPO3 7.6
Unfortunately, in Typo3 9.5.7 this seems not to work. As described above, I replaced html.html by this:
<f:format.htmlentitiesDecode>
<f:format.html parseFuncTSPath="lib.parseFunc">
{data.bodytext}
</f:format.html>
</f:format.htmlentitiesDecode>
I also replaced html.html by this, did't work for me:
<f:format.html>{data.bodytext}</f:format.html>
In the HTML-element I tested these variations of links, but none works:
<a class="download-link" href="t3://file?uid=107" target="_blank">Download (PDF)</a>
<link t3resources/cms/pdf/linux.pdf>Administration von Linux-PCs</link>
<link 27>Linktext</link>

Have your tried setting plugin.tx_powermail.settings.misc.htmlForHtmlFields = 1 in the constants?

Related

TYPO3 RTE convert <img> to <amp-img>

I have a TYPO3 version 6.2 website and I am working on a AMP version.
I use a condition in URL to load different versions of the same TYPO3 page depending if the page version request is AMP or not.
Regular version of the page :
https://www.novethic.fr/actualite/environnement/climat/isr-rse/rencontre-avec-danone-un-des-rares-francais-a-aligner-sa-strategie-sur-l-objectif-2-c-145150.html
AMP version of the page
https://www.novethic.fr/amp/actualite/environnement/climat/isr-rse/rencontre-avec-danone-un-des-rares-francais-a-aligner-sa-strategie-sur-l-objectif-2-c-145150.html
Everything works fine except if my page contains image inserted in the RTE
In this case I would need to convert <img> to <amp-img>for images inserted in the RTE when the version asked is AMP.
I already have a global var condition to load custom TS when AMP version is called.
But no idea how to convert <img> to <amp-img>
Any idea on how to achieve that?
if it is only a replacement of the tag name you could try to use a (conditioned) string replacement on one of these levels:
the whole page.
you could do a stdWrap.replacement, but that might not work on cached content
the page content in fluid.
just use a viewhelper to replace text of rendered content. that even could be a typoscript VH:
(<f:cObject typoscriptObjectPath="lib.img2ampimg">{content}</f:cObject>)
the page content in typoscript.
depending wether you render your content with TS you might add stdWrap.replacement there:
.
page {
10 = FLUIDTEMPLATE
10 {
:
variables {
content < styles.content.get
:
}
}
}
[--your amp condition--]
page.10.variables.content.stdWrap.replacement {
1.search = <img
2.replace = <amp-img
}
[global]
Maybe this could be achieved with the extension "Content Replacer", https://extensions.typo3.org/extension/replacer
I've solved it as Bernd Wilke suggested , but directly in my fluid template :
<f:if condition="{f:cObject(typoscriptObjectPath:'lib.conditionamp')} == 1">
<f:then>
<v:format.replace substring="<img " replacement="<amp-img layout=\"responsive\"">
<f:format.html>{article.corpsDeTexte}</f:format.html>
</v:format.replace>
</f:then>
<f:else>
<f:format.html>{article.corpsDeTexte}</f:format.html>
</f:else>
</f:if>
Thanks again for your help
:)

VHS: no image rendered with <v:media.image additionalAttributes

I am using T3 8.6 and VHS 4.1.0. I want to render the pictures from tx_news using srcset, sizes etc. It all works well as long as i Use additionalAttributes to get the sizes. No Image is rendered anymore.
Here is my partial:
{namespace v=FluidTYPO3\Vhs\ViewHelpers}
<v:media.image
src="{newsItem.falMediaPreviews.0}"
alt="{mediaElement.originalResource.alternative}"
class="float-sm-none float-md-left news_header"
srcset="300,600,900,1200"
treatIdAsReference="1"
additionalAttributes="{sizes:'(min-width: 90em) 900px,(min-width: 64em) 600px,(min-width: 30em) 100px,100vw'}"
Any Ideas what's wrong there?
It's Working Fine. Just Closed the tag. with using Latest version of flux , fluidcontent and vhs
<v:media.image
src="{newsItem.falMediaPreviews.0}"
alt="{mediaElement.originalResource.alternative}"
class="float-sm-none float-md-left news_header"
srcset="300,600,900,1200"
treatIdAsReference="1"
additionalAttributes="{sizes:'(min-width: 90em) 900px,(min-width: 64em) 600px,(min-width: 30em) 100px,100vw'}" />

TYPO3 7.6.2 fluid_styled_content remove div

I use TYPO3 7.6.2 and fluid_styled_content. With Gridelements my Code look like this:
<div class="col-md-12 col-sm-12">
<div id="c8">
<h6>Test</h6>
</div>
</div>
How can I remove the "div id="? If I use "css_styled_content" there is no problem.
Thanks
The whole rendering is defined inside the fluid templates (as the extension name suggests). So you are able to overwrite the folder containing the layouts / templates and modify them to your needs.
In case of "fluid_styled_content" the configuration is done in TypoScript, so add lib.fluidContent.layoutRootPaths.30 = /path/to/your/layouts, copy the original layouts from EXT:fluid_styled_content/Resources/Private/Layouts/ to your path and modify them to fit your needs.
In your case you have to remove the line:
<div id="c{data.uid}">
in all three layouts.
Further information are available at https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.3/Feature-66111-AddTemplaterootpathsSupportToCobjectFluidtemplate.html
#Daniel
Thanks for the hint.
Works for me too, but I had to add
lib.fluidContent.templateRootPaths.30 = EXT:extension/Resources/Private/Templates/
to my configuration, because, in my case I want to edit Textmedia.html and thats in Templates folder.

typo3 : how can i render page's content with fluidpages

In typo3 6.2, with fluidpage extension. (http://fluidtypo3.org/)
I create a page with 2 fluid content elements.
Im trying to render a page's content with fluid template.
This is my code :
<v:content.render column='0' pageUid="3" as="contentElement">
<f:for each="{contentElement}" as="content">
<f:debug title="Debug of MyArray">{contentElement}</f:debug>
</f:for>
</v:content.render>
Edit : sry, my mistake i didnt indeent the last line.
About debug, it change nothing, because contentElement is empty.
This displays nothing. When I check array's data, I got empty array.
Thanks in advance for you help.

Typo3 Fluid template cannot find css files using uri.resource

I followed this tutorial to create a Typo3 website using a Fluid template. However, I cannot get the CSS included in the template. In the tag the following css is included:
<link rel="stylesheet" href="css/bootstrap.css">
I rewrote this in the template to:
<link rel="stylesheet" href="{f:uri.resource(path:'css/bootstrap.css')}">
But the css is not included. The path to the template is:
fileadmin/templates/layouts/main.html
The path to the CSS file is:
fileadmin/templates/css/bootstrap.css
Where should I put the CSS files? And how should I include this css in the Fluid template?
Please keep in mind that pduerseler's way of doing it is better if you're using a plugin on many pages.
As for your problem, the uri.resource ViewHelper assumes that your resources are in the Resources/Public directory of your extension. So:
<link rel="stylesheet" href="{f:uri.resource(path:'css/bootstrap.css')}">
points to
typo3conf/ext/yourExt/Resources/Public/css/bootstrap.css
It is not possible to point to a file in fileadmin with the resource ViewHelper, see https://git.typo3.org/Packages/TYPO3.CMS.git/blob/HEAD:/typo3/sysext/fluid/Classes/ViewHelpers/Uri/ResourceViewHelper.php.
Current best practise for a TYPO3 page template is to have the template of a TYPO3 Website in an own extension, see e.g. https://github.com/georgringer/modernpackage
As a rule of thumb, you put JS and CSS files into your typoscript.
Example:
page = PAGE
page {
includeCSS {
myfile = path/to/my/file.css
}
includeJS {
myfile = path/to/my/file.js
}
}
This brings some benefits; You can organize your js and css in multiple files, and have TYPO3 concatenate and compress them by setting
config {
concatenateJs = 1
concatenateCss = 1
compressJs = 1
compressCss = 1
}
See more here: http://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Page/Index.html