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.
Related
Seems like a simple question, since you can do it with JS files, but I can't seem to find an answer.
I know for javascript things like moveJsFromHeaderToFooter and includeJSFooter exist in typoscript config, but no such setting for stylesheets.
I compress and concatenate my stylesheets as well, so the result isn't a static file either.
I am not discussing its right or not but if you want to move whole CSS to footer here is the solution:
Copy file public/typo3/sysext/core/Resources/Private/Templates/PageRenderer.html to some location in your basic extension like myext/Resources/Private/Templates/PageRenderer.html
In Template Typoscript put:
config.pageRendererTemplateFile = EXT:myext/Resources/Private/Templates/PageRenderer.html
In myext/Resources/Private/Templates/PageRenderer.html you see markers. Just move CSS markers you want to bottom.
The style tag is only valid in the head section. Thats why TYPO3 does not provide a move to footer option.
See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
So please create valid html
I have followed the tutorial for making a sitepackage and I am at the point of content mapping.
The problem is, all the text from the rte is being wrapped in <p> tags so the output looks like this:
<p><h2>A Heading</h2></p>
<p><p>Some Text</p></p>
The problem appears to be how fluid_styled_content is included, I have tried both:
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:fluid_styled_content/Configuration/TypoScript/setup.txt">
#import 'EXT:fluid_styled_content/Configuration/TypoScript/setup.typoscript'
The problem goes away if I manually add fluid_styled_content in the typo3 template includes. So how do I include it properly within my site package?
Problem is that the filename changed. You need to use: <INCLUDE_TYPOSCRIPT: source="FILE:EXT:fluid_styled_content/Configuration/TypoScript/setup.typoscript">.
You also can use the newer import: #import 'EXT:fluid_styled_content/Configuration/TypoScript/setup.typoscript'
I want to add the company logo to the default layout page in Typo3 (located in myextension/Resources/Private/Layouts/Page/Default.html).
However, using the relative path as a source in an img-tag does not seem to work (I used ../../../Public/Images/imagename.jpg). The console shows that Typo3 seems to be looking in the following location: http://localhost/Public/Images/addressicon.jpg.
How do I insert the image located at myextension/Resources/Public/Images/imagename.jpg?
How about /typo3conf/ext/myextension/Resources/Public/Images/imagename.jpg
I think EXT:myextension/Resources/Public/Images/imagename.jpg should work too.
Im using TinyMCE richtext editor on Umbraco website. but when i tried to add any section tag and save, it will remove it automatically.
Eg : <section class='cls'>test content</section>
Anyone knows how to prevent it ?
i've tried => extended_valid_elements: 'section[!class]' also not working for me
Allow the section tag with class attribute by going to config/tinymceconfig.config.
Look for validElements setting and include "section[class]".
You might also need to retouch and re-save your web.config in order for new settings to take effect.
I am very to new to zend frame work , I am trying to set up a project (Done by other programmer) in my local server, i have setted up this project, but all pages are styless in my browser, ie the CSS files are not taken in phtml pages, For solving this issue which file I have ti Edit?
Plss Help me
It depends upon the directory structure that your app has adapted. However checkout if you have views/scripts directory then, again depending upon the directory style used, the header.phtml file (if exist) will have invalid link to css.
If you dont have header.phtml, then use any text-editor and search in your views directory with keyword 'css', and you will get to know the possible file name.
Global css files I would add in the bootstrap file and any styles that relate to a page I would add in the relevant controller action for example...
global styles in bootstrap file
protected function _initView()
{
$this->view = new Zend_View();
$this->view->headLink()->appendStylesheet('css/global.css');
}
or in a specific controller action
public function myPageAction()
{
$view = $this->view;
$view->headLink()->appendStylesheet('css/myPageStyles.css');
}