I'm beginner in typoscript, I understand the principle, but I have a small problem from the start.
On my homepage in the setup field of the template-tools, if I put:
page.10 = TEXT
page.10.value = Hello World
It works, I have my display,
however, if I put:
page.10 = HTML
page.10.value = Hello World
it does not show me the text anymore ...
What do not I understand?
page = PAGE
page.typeNum = 0
page.10 = HTML
page.10.value = Hello World
Since TYPO3 6.0 there no longer is a HTML object in typoscript. So there is no rendering.
Try to avoid examples from very old days as TYPO3 has changed a lot.
You could look for typoscript errors in the TSOB (TypoScript Object Browser) or Template Analyzer
(see: Web -> Templates -> ... drop down selection on top of page)
As mentioned above, the HTML Content object has gone.
Valid solution: just use the TEXT object for such HTML output.
Note the stdWrap.htmlspecialchars thing.
(Read more: https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/Functions/Stdwrap.html#htmlspecialchars)
If you use both in connection correctly, it is a save and recommended way.
Although maybe HTML output should sit better in a FLUID template or partial.
But still there are some usecases for our approach.
Related
I want to use links with <f:link> in HTML element inside handler and in Typoscript with typoscriptObjectPath, for example:
<f:link.page pageUid="13" >Test Page Link</f:link.page>
But they always appear to me as plain text.
I'm using Typo3 11 and Fluid Template.
Do you have to activate something so that it renders as it was done before with the old old link parser?
Let's see if someone can help me
If you wanna get a text parsed as HTML, just use f:format.html() in your Fluid Template. It renders a string by passing it to a TYPO3 parseFunc. By default lib.parseFunc_RTE is used to parse the string.
I made it.
Set the links in Typoscript this way:
lib.redesp = TEXT
lib.redesp.value = Test Link
And in the Fluid template set:
<f:format.html parseFuncTSPath="lib.parseFunc">
<f:cObject typoscriptObjectPath="lib.redesp"/>
</f:format.html>
Don't know if this is the best way, but it works.
I'm looking for a way to get the page title set via the new PageTitleProvider API to display it inside a FluidTemplate.
In one of our TYPO3 installations, the page title is used as title, displayed on the page itself. The main PAGE object is set up to render a FLUIDTEMPLATE object. I've implemented the examples on the new PageTitleAPI in the documentation, https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/PageTitleApi/Index.html into my extensions and that works just fine for the tag.
However, within the page itself, the title set in the page is still displayed, not the title I've set in my extension.
I've figured out, that I can instantiate the PageTitleProviderManager, but getTitle still resolves to the page name, not the title I've set, most likely because this object is resolved before the PageTitleProviders are set up by the extensions.
$pageTitleProviderManager = GeneralUtility::makeInstance(\TYPO3\CMS\Core\PageTitle\PageTitleProviderManager::class);
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump( $pageTitleProviderManager->getTitle() );
// -> outputs the page name, not the title custom page title
Is there a way to resolve the page title after all Providers are processed and display it in a fluid template?
I also assume it depends on order of execution. so you need to build an order where your plugin is executed before the page title is rendered in the page template.
nowadays most integrators use the f:cObject viewhelper to render the content with lib.content. that means the content (and your plugin is rendered very late), as the page title is probably rendered before any content in the page template (independend whether you use template variables from the page template or a viewhelper which executes PHP or typoscript in the moment of the rendering.
Here you get a hint how to change the order:
try to render the content (including plugins) into a fluid-variable with the page templating ( e.g.:
page.10 = FLUIDTEMPLATE
page.10.variables.content < styles.content.get
) and try to get the page title when the page fluid is rendered: use a viewhelper to get the page title when the initial FLUID variables are already computed.
of course you also can define a FLUID-variable for the content in the page FLUID template before accessing the page title by viewhelper:
<f:variable name="content"><f:cObject typoscriptObejctPath="lib.content" /></f:variable>
I created a custom content element with a "bodytext" field like this:
bodytext;Text;;richtext:rte_transform[flag=rte_enabled|mode=ts_css],
rte_enabled;LLL:EXT:cms/locallang_ttc.xlf:rte_enabled_formlabel
The text editor doesn't work properly. The links for example are formated like this:
<link 88 - internal-link>test</link>
which doesn't work in the frontend.
RTE is also throwing a lot of info and errors in the backend, here is a screenshot of firebug:
If I use a core content element like "text & media" RTE does work perfectly .. So I guess there is some configuration missing in my extension ?
How did you set up your custom content element? In which file did you set up your bodytext field shown above?
The link formatting like <link></link> is the normal and correct behavior of the RTE. By this way, links can be rendered dynamically having the pageid saved and they will still work even if the domain or pagetitle of the target page changes - this would not work if links would be saved "hard" like <a href="xy">.
However, those link tags have to be rendered using the lib.parseFunc_RTE when outputting the content. For example if you use Fluid for output, just use <f:format.html>{yourBodytextVariable}</f:format.html> and you will get correct links (f:format.html uses lib.parseFunc_RTE by default).
Check out your Typoscript Object Browser to find out more about the lib.parseFunc_RTE object and check out this doc: https://docs.typo3.org/typo3cms/TyposcriptReference/Functions/Parsefunc/Index.html
I am attempting to use Fluid templates to render pages. I have created an extension file provider and some page templates which appear to be rendering.
Unfortunately, the content I add to pages is not rendering.
I am attempting to follow the example in the Flux documentation (Two-column page template and Page Rendering sections).
I have also been reading the Creating Page Template page in the Fluid documentation.
When I do this, it correctly makes the grid layouts available in the TYPO3 backend.
However, when I select one of those layouts for a page, and then add some content, the content is not rendered in the page.
Am I missing a step? For example, is there some Typoscript I need to write here? The documentation appear to be incomplete/unfinished.
I have tried adding the following Typoscript in Configuration/Typoscript/setup.txt:
page {
10 {
variables {
left < styles.content.get
left.select.where = colPos = 0
right < styles.content.get
right.select.where = colPos = 1
}
}
}
But it had no effect.
Did you include the static templates of either css styled content or fluid styled content?
Encountered an issue today where I made tweaks to the a TYPO3 page and the page became blank. The <body> tag was empty!
I fixed it by clearing cache, but I also found another page with the same problem later on.
Doing some research I found that the page is empty on the cache_pages table.
What is causing it? I am using TYPO3 4.5.6
It happened to me. and the cause was, in the fluid template?
Instead of using fluid template, i just use the regular html tag if you didn't initiate the view helper or something in your form.
This usually happens, if you don't have a PAGE TLO.
Make sure your main template includes something like:
page = PAGE
page {
10 = TEXT
10.value = Hello world!
}
You might have cleared it by accident.