How do I move or include compressed and concatenated CSS to footer in TYPO3? - typo3

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

Related

How to put content elements side-by-side int typo3

I have just started my Typo3 journey. I want to put 2 content elements side-by-side (in one row). Can anyone tell how is it possible. Because whenever I place any content element, it is displayed as a block and fill the entire row.
Thank you for your time and consideration :)
You have to use container elements which come with the extension 'container'. Please have a look at https://extensions.typo3.org/extension/container
There is no build in solution for your problem.
But in TYPO3 you are free to build any kind of html structure for your output. This is necessary as you also can do any rendering of content. either with your own CSS and HTML-markup or if you use frameworks like Bootstrap.
You can build a new page layout, or any special content element which contains other content elements.
Changing layouts can (and should) be reflected in backend-layouts. (https://docs.typo3.org/m/typo3/reference-coreapi/11.5/en-us/ApiOverview/Backend/BackendLayout.html) (there are a lot of other tutorials)
But you also can build/ use individual defined containing content elements. Her you can get support by different extensions (eg. mask, DCE, gridelements) or define it completely on your own (https://docs.typo3.org/m/typo3/reference-coreapi/11.5/en-us/ApiOverview/ContentElements/Index.html)

Vscode extension: insert some meta text on a certain position?

I think it should be possible.
I want to make an extension that will add a specific meta text content on specific positions in the source file (depending on its content), but this content should be just visible to the user not inserted into the source of course.
Can someone point to the VSCode API which I should use for this?
I think I found it:
https://code.visualstudio.com/api/references/vscode-api#TextEditor.setDecorations
This extensions also uses it:
https://github.com/wix/import-cost

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.

Exporting org-mode to HTML: Include custom sitemap above the title

I would like to include a short sitemap like
[[./page1.org]] [[./page2.org]] [[./page3.org]]
which I have contained in a file called sitemap-banner.org, but I would like for this to appear at the top of the page, above the title. When I start an org-mode document with
#+INCLUDE: sitemap-banner.org
#+TITLE: pagetitle
and export as HTML, the title still appears above this banner. Is there a way to change this behavior, or are there any other suggestions for including such a sitemap?
I guess this must be solved through CSS placement rules.

What is the best way to enable content authors to add images with captions in Expression Engine

There's a module to do this in Drupal land, but I've been frustrated with the hacks that've been necessary in Wygwam. What is the best way to go about implementing this in such a way that you don't need to totally override the default image handling in ChannelImages/Wygwam?
Assets is a good suggestion, but I believe Devdemon's channel images might be a better fit for the workflow you're suggesting.
http://www.devdemon.com/channel_images/
Clients can add (and see) a caption and more and it's fully integrated with Wygwam and other editors. Devdemon's support is also excellent.
The Assets module from Pixel & Tonic allows you to double-click on the image (or any other file) and add metadata. You then have access to the metadata in your templates.
Check the screenshot: http://pixelandtonic.com/assets
You can also add metadata using the native File Manager. Click the edit icon from the File Manager and you'll see a few fields. You can use the File Entries tag to access it.
http://expressionengine.com/user_guide/modules/file/file_tag.html
I typically use Matrix with one column for the image, one column for the caption, and if a link is needed another column for the link. This of course works best if the image is in a fixed location within your template.
On possible way to accomplish this that I have used is to run some jQuery that looks for images within a certain area, and if they have alt attributes, rewrite the image tag within a tag with a tag inside.
so:
jQuery(document).ready(function() {
$('#page-content > .wrapper img').each(function(){
if($(this).attr('alt') !== undefined && $(this).attr('alt').length > 0){
if(!$(this).parent().hasClass('content-image')){
$(this).replaceWith("<figure class='content-image "+$(this).attr('class')+"'>"+$($('<div></div>').html($(this).clone().attr('class',''))).html()+"<figcaption>"+$(this).attr('alt')+"</figcaption></figure>");
}
}
});
});
will do just that. It's looking within a #page-content div for img tags with alt attributes. And then rewriting it as
<figure><img src='....' .... /><figcaption>This is the text that was in the alt attribute</figcaption></figure>
Soooo, that kinda works. The only caveat is that you had better not use any double-quotes within your alt text, or it will break thangs. Not the cleanest of solutions, but a solution, nonetheless.