Load specific style sheet for each frontend plugin - TYPO3 Extbase - typo3

Using TYPO3 version 8
I have a custom extension that contains three frontend plugins.
For each of the three plugins I have a separate stylesheet for each of them.
Currently, all three style sheets are loaded even if one of the plugins isn't loaded on that page.
My setup.ts:
page.includeCSS.tx_myextension_frontendpluginONE = EXT:myextension/Resources/Public/Css/frontendpluginONE.css
page.includeCSS.tx_myextension_frontendpluginTWO = EXT:myextension/Resources/Public/Css/frontendpluginTWO.css
page.includeCSS.tx_myextension_frontendpluginTHREE = EXT:myextension/Resources/Public/Css/frontendpluginTHREE.css
Question:
Using only Typoscript, can I load a stylesheet for each plugin and not have it load if the plugin is not displayed on the page? I assumed it would sit somewhere in my extension configuration:
plugin.tx_myextension_frontendpluginONE.settings {
Call it in here perhaps?
}
Thanks again.

Related

Adding TinyMCE plugin with toolbar icon using a module package in Episerver CMS 12

I have a custom TinyMCE plugin that add a toolbar icon to the tinymce tool bar. Plugin is configured in a file called editor_plugin.js which is placed inside my custom EpiServer module. I need this to register in tinyMCE.
I added following code in the startup.cs file:
services.Configure<TinyMceConfiguration>(config =>
{
config.Default()
.AddEpiserverSupport()
.AddExternalPlugin("qbankmodule", "/QbankModule/TinyPlugin/editor_plugin.js")
.AppendToolbar("qbankmodule");
});
but I am getting following error in TinyMCE toolbar area:
Failed to load plugin url: http://localhost:8000/EPiServer/EPiServer.Cms.TinyMce/3.1.0/ClientResources/tinymce/QbankModule/TinyPlugin/editor_plugin.js
I Have following questions:
How can I point this to the editor_plugin.js file in the QbankModule I have it as QbankModule/TinyMCE/editor_plugin.js but now it is loading from EPiServer.Cms.TinyMce module.
Instead of registering this in the startup.cs since our product it this QbankModule, we need this to be registered using Customized TinyMce Initialization module using IConfigurableModule. Any one have experience in this area how to implement that?

How to set the body background for typo3 without or with extension?

I am using typo3 v9.5.0. I need to design a website with a background image wrapped all over the content element and menu. There is no specified layout in bootstrap package. I've tried extensions like background by uploading the image.
But there is something wrong. By default its pointing the wrong resource which it left(typo3/01_DBM).
I have no clue why it's behaving like that. If there is any other extension or technique, kindly suggest me. But I want it to be done dynamically because it needs regular updation.
TYPO3 9.5.0 is outdated. although you use it localy update to current version.
you have multiple options to integrate a background image to the whole page.
Here my recommandation which does not require any specific extension:
As you use the bootstrap-package you can enhance the Fluid-templates of it in your own site-extension (which you should use).
Where do you get the image from?
Every pages record (defining a page in TYPO3) has fields for related media files (you can find/set it on the Resources tab.
Here an editor can easily insert an image which should be used as a background image to the content.
In your typoscript definition of variables for the page you can define an own variabel for the first image
10 = FLUIDTEMPLATE
10 {
[...]
dataProcessing {
111 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
111 {
references {
fieldName = media
table = pages
}
as = BackgroundImages
}
}
[...]
}
and use it in the fluid template for the page like:
[...]
<div style="background-image:url(fileadmin/{BackgroundImages.0.originalFile.identifier});">
<f:cObject typoscriptObjectPath="lib.dynamicContent" data="{pageUid: '{data.uid}', colPos: '0'}" />
</div>
[...]
further enhancements could use a sliding mechanism, so a page without own background-image could use the image of parent page.

Adding own CSS to TYPO3 backend [v9]

I am trying to add some CSS styles to the TYPO3 backend (v9). I've added the stylesheet and the following line to the ext_tables.php of my own extension (as described in the file typo3/sysext/backend/Classes/Template/DocumentTemplate.php).
$GLOBALS['TBE_STYLES']['skins'][$_EXTKEY]['stylesheetDirectories'] = ['EXT:my_extension/styles.css'];
When I check the configuration, the new entry show up, so that looks fine. But I don't see any style changes to the backend.
Any ideas anyone? Thanks!
As the key value (stylesheetDirectories) indicates, this should point to a directory. It will add all .css files in that directory.
Also, don't set $GLOBALS['TBE_STYLES']['skins'][$_EXTKEY]['stylesheetDirectories'] as a new array, but use $GLOBALS['TBE_STYLES']['skins'][$_EXTKEY]['stylesheetDirectories'][] = 'EXT:my_extension/styles/';. That way other extensions can also add stylesheets without it being overwritten by your extension.

TYPO3 7.6 TCEFORM Custom Layouts doesn't work

I upgraded TYPO3 6 to 7.6.x and now I can't choose custom layouts in the backend for any content elements in the backend. I only see the default options like "layout 1, layout 2". The reason is obviously that my TCEFORM addings doesn't work..
The following typoscript won't have any effect in a ext-template of a page or in the root setup.ts:
TCEFORM.tt_content.layout.altLabels.2 = Test
TCEFORM.tt_content.layout.removeItems = 2,3
TCEFORM.tt_content.layout.addItems.5 = New Item
I know the problem description is a bit inaccurate. But I don't see the relevant infos which u need. Can u give me an advice what I have to check? Are there known conflicts with extension like fluidcontent, css_styled_content or so?
TypoScript configuring the back end is (though TypoScript by syntax) often called TSConfig and can be added either in page records or via user settings but never in extension templates or similar.
Configuring TCEFORM is usually done in page properties. To add, open page properties of your root page (or the topmost page of the subtree you want to configure) and add your code there.
As in front-end TypoScript you can swap your code to external files.
You need to add this typoscript on Root Page in Page TSconfig.
Edit root page properties and add your typoscript in Resources tab in Page TSConfig section like below image, so it's work fine.

not able to register two plugins of touch-ui rte dialog

I am using the steps given in the URL to make a color-picker rte plugin
http://experience-aem.blogspot.in/2015/01/aem-6-sp1-touchui-richtext-editor-color-picker-plugin.html
and at the same time I am making another custom rte plugin to do some text modulation.
But only one of them is working using rte.coralui2 as categories.
and both icons are coming at the same location.
If I disable one js then another is working.
I have registered the plugin with different name and I have also used different variables.
I am not able to make the rte plugin button at different location.
Please suggest the possible solution.
it's possible you are overlaying rather than extending the rte.coralui2 category. I suspect your custom clientLibs are competing with each other and only one is available.
It seems like you are using the same steps provided in the blogpost for creating both the plugins and while doing that, you are using the below code twice with different icons :
if(items.indexOf(ExperienceAEM.TCP_UI_SETTING) == -1){
items.splice(3, 0, ExperienceAEM.TCP_UI_SETTING);
}
So, maybe, the icons are being added at the same place and only one of them is shown.
You should create ExperienceAEM.CuiToolbarBuilder Class only once and add both icons inside that class