Connecting and Adding of One Extension template inside of Another extension template ? in typo3 - typo3

Is there any way to do to include one extension template (Html ) inside of another extension template (Html file) without affecting the functionality.
Eg: I have 2 extensions inside of a website 'ext_included' with 'N_includefile.html' template and 'ext_package' with 'N_package.html' respectively,i need to use the N_includefile.html inside of 'N_package.html'
is there any way to do this??
Anyone know about this?is there any possibility to do this

This is not possible out of the box but can be achieved by 2 ways:
1) Adopt the structure of your partialRootPaths.
Adopt the TS to have something like this
plugin.tx_ext1.view.partialRootPaths {
10 = EXT:ext1/Resources/Private/Partials/
20 = EXT:sitePackage/Resources/Private/GlobalPartials/
}
plugin.tx_ext2.view.partialRootPaths {
10 = EXT:ext2/Resources/Private/Partials/
20 = EXT:sitePackage/Resources/Private/GlobalPartials/
}
and then you can use the same partials
2) Use EXT:fluid_components
Using the extension EXT:fluid_components makes it possible to organize your templates in a better way with atoms, molecules and you can even create an automated styleguide with EXT:fluid_styleguide

Related

Custom tags in TYPO3 content

new here, and also new to TYPO3.
I need to put something like [imagebox, title='box1'] into content editor and that will be replaced by a text and image with some javascript effect (text and image are managed in the DB elsewhere, the tag is just for the placement in the page).
I've read that TYPO3 has a mechanism for adding custom tags and I managed to make them accepted in the RTE.
I tried instead of [imagebox..... to use
<imagebox>box1</imagebox>
with something like this (copied from web):
tt_content.text.20.parseFunc.tags {
imagebox < lib.parseFunc.tags.link
imagebox = TEXT
imagebox.value= replaced
# imagebox = PHP_SCRIPT
# imagebox {
# stripNL = 0
# Pass a parameter from Typoscript to a PHP script:
# UID of the page containing the SINGLE view of tt_news
# id_singleView = 18
# Call the PHP script
# file = fileadmin/scripts/imagebox_parser.php
# }
}
lib.parseFunc.tags.imagebox < tt_content.text.20.parseFunc.tags.imagebox
should be able to replace content between tags.
I've commented call to php function just tried to get a text replacement for starters.
I've put that in the main root template Setup, but nothing is replaced.
I've also tried other examples from the web with no success.
Did anyone have situation like this?
Are there better approaches for that in TYPO3? (I'm using v7.6.23)
Any suggestion or hint is appreciated.
EDIT: using FSC on textmedia element
I think your examples are outdated. (the object PHP_SCRIPT is obsolete for a long time)
You might have a look at the documentation for your TYPO3 version:
https://docs.typo3.org/typo3cms/TyposcriptReference/7.6/Functions/Parsefunc/
you also need to enhance the parsefunc where you need it. That can depend on:
CSC or FSC?
which kind of content element (CE) do you use? (be sure to enhance the rendering of that CE)

Can i add more colors in tx_gridelements

i want to add more backend colors in Typo3 Gridelements.
Under Typo3 -> List -> CE Backend Layout is an Option "Frame" with 4 colors and i want to add more colors.
Is there a way for it?
Best Regards
You probably want to use something like this in your pageTS:
TCEFORM.tx_gridelements_backend_layout{
frame{
addItems{
10 = unicorn-pink
}
}
}
You can change every field from every table with this method.
See https://docs.typo3.org/typo3cms/TSconfigReference/PageTsconfig/TCEform/Index.html for further information about this.
Just adding the value in TCEFORM might not be enough, since you will need to add CSS to get the colors assigned to those new classes.
So you will at least need to have a small extension providing the items, a basic folder structure as in the usual sitepackages and the CSS embedded via ext_tables.php and/or ext_localconf.php

Order of Constants TS in Template Analyzer

i'm struggeling with the order of typoscript in constants. I've a provider extension holding all the templates and files for the site. Typoscript ist used in external files, i don't want to store typoscript in the database. I use typo3_forum ext and want to modify the templates to customize it. But when i put the ts for the view like:
plugin.tx_typo3forum {
view {
templateRootPath = EXT:provider/Resources/Private/Templates/Forum/Standard/
partialRootPath = EXT:provider/Resources/Private/Partials/Forum/Standard/
layoutRootPath = EXT:provider/Resources/Private/Layouts/Forum/Standard/
}
}
these values will be overwritten by the typo3_forum ext itself, cause the constants of typo3_forum ext stands in the templateAnalyser hirachy under my provider extension.
Sure storing the above ts in the constants field of my roottemplate solves the problem but is there no solution for external fiels to sort?
I've tried:
plugin.tx_typo3forum.view.templateRootPaths.100 = EXT:provider/Resources/Private/Templates/Forum/Standard/
but this doens't work, the ext uses the default template in that case.
Thanks for your help!
Cheers Mark
Put your line
plugin.tx_typo3forum.view.templateRootPaths.100 = EXT:provider/Resources/Private/Templates/Forum/Standard/
in the setup, not in constants.
You can move the path to constants like
Constants:
plugin.tx_typo3forum.view.myTemplateRootPath = EXT:provider/Resources/Private/Templates/Forum/Standard/
Setup:
plugin.tx_typo3forum.view.templateRootPaths.100 = {$plugin.tx_typo3forum.view.myTemplateRootPath}
If using TYPO3 version 8, take a look at https://forge.typo3.org/issues/75862. There is a bug regarding the fallback for template paths. The issue has been solved already and is targeted for version 8.4
The order of TS appearing in the template analyser simply reflects the order in which the files are loaded.
If you are already using a provider extension for your TypoScript and don't put any TS statements in the database (which is a good practice) you can go one step further and put no extension TS in the database at all (not even include static templates in the template record).
Just include the TypoScript files that you need in your provider extension with <INCLUDE_TYPOSCRIPT and you have complete control of the order of things.
In the database you have to put just one line in constants and one in setup, each of the including from your provider extension. This will also make you less dependent of the database because if you include a new file it is just loaded and no actions are needed in the actual template record in the backend.

In TYPO3, reintroduce page.includeJS with config.disableAllHeaderCode = 1

To get clean Markup, I have set
page.config.disableAllHeaderCode = 1
in TYPO3 6.1
This allow full control over the template, but also disables functionalities like page.includeJS, page.includeJSFooter etc. Basically, this is intended - but is there a way to bring back that functionality (e.g. when an extension uses it) and reintroduce the generated code punctually into the template?
Something like
page.10.marks.JSFOOTER < page.includeJSFooter
?
This is technically impossible, see https://git.typo3.org/Packages/TYPO3.CMS.git/blob/HEAD:/typo3/sysext/frontend/Classes/Page/PageGenerator.php#l237
When disableAllHeaderCode is set, the content isn't wrapped at all with the header information. Since the header data is built on runtime, you cannot store it and re-use it.
What are you trying to achieve?

typo3 extension two times on page, different setup?

I have written a Typo3 extension that I want to put 2 times on the same Typo3 page (actually in two parts defined through a templavoila template), but the two instances need different setups!
When I add content to the page through the "Page" module, I can add as many instances of my extension as I want. But in the "Template" module, there is only 1 configuration per page.
So my question is: what is the best way to have different typoscript setups for different instances of a single plugin on the same page?
Thanks for any hints!
If a configuration option is not available as flexform, or there are other reasons why to change the options via TypoScript, you may do it like this:
temp.tx_yourextension < plugin.tx_yourextension
plugin.tx_yourextension >
plugin.tx_yourextension = CASE
plugin.tx_yourextension {
# check for the uid of the content element (the plugin)
key.field = uid
# if nothing special is defined
default < temp.tx_yourextension
# the plugin with the uid 1234 needs different configuration
1234 < temp.tx_yourextension
1234 {
property = whatever
}
}
Instead of requesting the uid, you could check for section_frame or any other field.
But keep in mind, some extensions accessing directly the TypoScript via $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_yourextension.']['property'] which will prevent this option.
You could do the same on tt_content.list.*
# without tx_ prefix
temp.yourextension < tt_content.list.20.yourextension
tt_content.list.20.yourextension >
tt_content.list.20.yourextension = CASE
...
Why using template configuration? You could define some configurations for the frontend plugin itself (with flexforms), so every instance could be customized.
You can use the flexform to have different setups. Each flexform is stored in a separate database field.