TYPO3 shariff extension language detection - typo3

I use TYPO3 6.2 and the Extension shariff. The default language of this extension is english, but the buttons are always translated to german. My website is multilingual (en, de). The Buttons are included via backend for both languages. How could I define the language per content element "Shariff Social Icons"?

Please clarify your question a bit. What do you mean by "language per record"?
The language is detected automatically from the language configured for the current page. So it automatically adjusts if the language is changed.
See also: https://docs.typo3.org/typo3cms/extensions/rx_shariff/Installation/Index.html#fluid-view-helper
If you need to set a language manually you can do that via the data-lang attribute.

You can add override for Shariff Index.html by copying typo3conf/ext/rx_shariff/Resources/Private/Templates/Shariff/Index.html to typo3conf/ext/YourExtension/Resources/Private/Templates/Shariff/Index.html (your extension / override template path)
And add following override to setup typo-script:
plugin.tx_rxshariff.view {
templateRootPaths{
2 = EXT:YourExtension/Resources/Private/Templates/
}
}
Add your modification to your overridden file (typo3conf/ext/YourExtension/Resources/Private/Templates/Shariff/Index.html).

Related

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.

Change label of flexform select item in TYPO3 extension tx_news

I want to add a new sorting option to the flexform in the frontend plugin of the TYPO3 extension tx_news. This works fine so far with these additions:
ext_tables.php of my theme extension:
$TYPO3_CONF_VARS['EXT']['news']['orderByNews'] .= ',archive';
TypoScript configuration within my theme extension:
plugin.tx_news.settings.orderByAllowed := addToList(archive)
What I miss now is the possibility to change the label of the new item archive in the select field Sort by of the flexform.
I assume it is done via page TSconfig and TCEFORM.tt_content.pi_flexform.news_pi1.sDEF.settings.orderBy but I can't figure out exactly how.
TYPO3 version is 6.2
This did the trick for me:
TCEFORM.tt_content.pi_flexform.news_pi1.sDEF.settings\.orderBy.altLabels.archive = LLL:EXT:my_theme/pathto.xlf:archive
It's important to escape the dot before the fieldname!
I never tried to use pageTS to localize (only template TS), so I don't know if it is actually possible. I would however suggest localizing the label using the locallang files, in this case creating locallang_db.xlf in appropriate path in typo3conf/l10n/ with localization for tx_news_domain_model_news.archive label.
More info here: https://wiki.typo3.org/Translations#Translation_internals.2C_how_does_it_work.3F

TYPO3 - How to add a placeholder to an input field?

In TYPO3 (7.2.0) using the standard template engine, is there a way to add a placeholder attribute to the standard mail form text input?
At the moment I am using JavaScript to convert the labels into placeholders, but I am open to suggestions on a better way to do this...
The suggested solution of #biesior does only work for EXT:form 7.4 and higher (see changelog). The supplied picture shows the form wizard of TYPO3 7.5 or 7.6. In 7.2 you won't find any placeholder attribute in the wizard.
I recommend updating to TYPO3 7.6 since this version includes a major rewrite of EXT:form. You will be able to use fluid templates to customize your forms. Furthermore HTML5 attributes are possible. Before the rewrite the set of allowed attributes was quite limited. Now you are able to add all attributes you can think of (for example "data-"). See changelog.
If you have any questions regarding EXT:form join the channel on Slack. If you don't know Slack yet, check out the invite function.
During form fields editing you have many properties, also Placeholder
in text version it will be:
10 = TEXTLINE
10 {
type = text
class = foo-class
id = foo-id
name = foo
placeholder = Hmmm?
required = required
label {
value = My Field
}
}

How to rename subheader in TYPO3 CMS backend

How can I rename a TYPO3 CMS backend field for authors? i.e. the mentioned field for content-elements of csc_styled_content?
In general, overriding label names can by done with Page TSconfig in the backend. The following example modifies the label of the subheader field.
TCEFORM {
tt_content {
subheader.label = My new Label-Name
}
}
There are two way to configure that adjustment in TYPO3.
Type your configuration changes directly to the page settings » resources » TypoScript Configuration » Page TSConfig (see the screenshot below)
as an alternative you can store that configuration directly in the file system - either in your custom extension (e.g. at typo3conf/ext/my_extension/Configuration/TSconfig/labels.t3s) or with a similar name in the global file storage (e.g. fileadmin/templates/configuration/...)
That's basically it to provide custom labels for any database table in the TYPO3 backend. Find more aspects that can be adjusted in the accordant Page TSconfig documentation.
If you want to rename a field of an extension like tx_news you could do it this way.
TCEFORM {
tx_news_domain_model_news {
title.label = Your New Label
}
}
Now there are two ways to get this to work:
Put it in Page TSConfig of the page settings
OR
Load it with your extension from a file (e.g. EXT:my_extension/Configuration/pageTSConfig.typoscript). For that you have to import this script by EXT:my_extension/ext_localconf.php!
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:my_extrension/Configuration/pageTSConfig.typoscript">');

TYPO3 tx_news more-link only showing default translation

In TYPO3 tx_news i have the more-link, but it only shows the default translation in every language.
My default language is Danish.
In items.html I have this:
<f:translate key="more-link"/>
In my TypoScript I have this
plugin.tx_news._LOCAL_LANG.de.more-link = mehr
plugin.tx_news._LOCAL_LANG.en.more-link = read more
plugin.tx_news._LOCAL_LANG.default.more-link = læs mere
I can also see these values in TypoScript Object Browser.
But on the English and the German page the link text is "læs mere".
What could be wrong?
Check your language settings in your setup TypoScript.
You should set for english:
config.language = en
and for german:
config.language = de
This configures the system “language key” to be used for the language.
This is used to select labels from XLF files. Setting this should make
frontend plugins respond by showing labels from the correct language
(requires installation of the corresponding translations).
Actually with the settings above you change in TypoScript the default values from a language file. As you see you are using there the de and en properties. This settings should be set correctly in your config also to enable TYPO3 to match them.
Documentation is here.