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

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

Related

Adding Templavoila template to Typo3 blog

I am pretty new to Typo3, and I am sorry if my question is too easy to answer =)
I'm using Templavoila and I installed the Typo3 Blog extension (T3G?) and I ticked the checkbox "Install and use the template provided by the extension" when setting up my first blog. I hardly managed to get a html only page with a sidebar and list of posts.
My problem is that I can't find a way to add a template or any CSS to that page. I'd like to fit it into the rest of my website with the logo, menu, etc… but after a day of searching and reading, I haven't find a solution to my problem.
Is the problem that I'm using Templavoila rather than FLUID?
Is there a way to add a TV template to my blog?
How can I add CSS to that page (I have tried page.includeCSS.style without success)?
Is it possible to fit that blog in the rest of the website?
I'm using : Typo3 7.6 - Typo3 Blog 7.6 - Templavoila! Plus 7.2
PS : Is it just me or is it pretty difficult for new people to make their way into Typo3 ? ^^ I'm probably just missing something obvious but there isn't much documentation or tutorials dedicated to beginners. I hope it get's easier =)
Templavoila (and Templavoila plus) operate its "magic" by its function to show the content; thus you don't need anymore the usual TypoScript:
page.10 < styles.content.get
Instead, the page content must be replaced with:
page.10 = USER
page.10.userFunc = tx_templavoilaplus_pi1->main_page
Be sure to enable the TemplaVoila page module to manage content with TemplaVoila.The reason is that the "bare" TYPO3 uses the colPos field to retrieve the content (e.g. styles.content.get means colPos=0) while as far as I remember TemplaVoila uses its own logic and the TemplaVoila page module is necessary (also, as far as I can remember,there is an option to map a TemplaVoila content container to the colPos but I could possibly be wrong).
This is only part of the answer I was looking for, and it was probably obvious (well not for me indeed).
In the options of the blog template (the Typoscript one) I had to uncheck all the checkboxes (Clear constants, clear setup, rootlevel).
I also deleted the page.10 < styles.content.get, if I don't I get all the content but again, HTML only.
I'm facing a new problem now. The list of posts is not showing. Only regular element like text elements are being displayed, the Templavoilà FCE aren't… It is worse for the blog posts, nothing at all is being displayed.
PS : Should I write a new question for this or is it okay to ask it here ?
as maintainer of the TemplaVoilà! Plus extension I'd like to help you. Till yet, I didn't tested the blog extension, but I'm willing to help you there.
Couls you please fill an issue report on https://github.com/pluspol-interactive/templavoilaplus/issues and add there a link to this discussion?
Thanks
PS: I know, this isn't a answer to the question, but not enough reputation to add a comment.

What is the difference between f:link and f:uri ViewHelpers in TYPO3 fluid

There are a number of viewhelpers which can be used in Fluid. The f:link and f:uri seem to do basically the same thing.
For example:
f:link.external :
"A ViewHelper for creating links to external targets."
f.uri.external :
"This ViewHelper creates a link to an external page"
This results in the following questions:
What's the difference between f.link.external and f.uri.external (and which is supported in which Fuid / TYPO3 version?).
For which TYPO3 version is the documentation "Extbase Guide"? Because usually you see a version in lower left column, here it just shows 'latest'.
What is the best up-to-date resource for Fluid ViewHelpers using TYPO3 8?
All link viewhelpers in Fluid render a full HTML link, so <a href="..." ...>...</a>. In comparison all uri viewhelpers only render the URI, thus what would end up within href of a link or e.g. a src() in CSS.
The Extbase guide is rarely updated and there is no real version dependency. If at all it applies to the latest LTS but you'll find outdated info here and there.
There are some docs around the net which cover parts of Fluid but there is no definite guide which contains everything. Here are a few resources:
Viewhelpers reference in Fluid powered TYPO3
Viewhelpers in the Fluid Guide
Source code of TYPO3 Fluid
Source code of TYPO3
You are very welcome to improve the docs wherever you see something amiss. :-)
f.link.external actually creates a link and f.uri just outputs the uri.
f.link.external
Fluid Source:
<f:link.external uri="https://typo3.org">f.link.external</f:link.external>
Result:
f.link.external
f.uri.external
Fluid Source:
<f:uri.external uri="https://typo3.org">f.uri.external</f:uri.external>
Result:
https://typo3.org
It might be a good idea to update the documentation for f.uri.external because it is misleading.

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.

TYPO3: HTML template on multiple pages

I have installed TYPO3 and am working with a HTML template and markers to display content.
There is only one thing i am asking myself:
I have several pages with the same layout but different content and I only want to change parts of these contents.
Do I have to implement a specific template for every page to make this work or is there any other way?
(the red marked content shall be changed only)
I hope you got the point what I want to achieve and can answer my question.
there is a bootstrap introduction package that you can install (look at packages in the extension module)
https://typo3.org/extensions/repository/view/introduction
based on:
https://typo3.org/extensions/repository/view/bootstrap_package
there is no need for gridelements or DCE.
when you are a TYPO3 beginner, the introduction package gives you a good start because it stays close tho the TYPO3 'core' way of creating a website.
After you have learned how to create basic templates (with backend layouts & FLUIDTEMPLATES) you can deep into other extension like DCE or gridelements.
You can either create a template for each page or use one template for the whole content and then use some other extensions to create the grid view.
For this job the best extensions are:
dce - dynamic content element dce extensions
-- or --
gridelements gridelements extension

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