TYPO3 v10: How to remove meta tag generator? - api

<meta name="generator" content="TYPO3 CMS" />
I could use the Meta Tag API
$metaTagManager = GeneralUtility::makeInstance(MetaTagManagerRegistry::class)->getManagerForProperty('generator');
$metaTagManager->removeProperty('generator');
but I would need some Default Controller/Action for all Pages which I dont have.
maybe I can hook into the PageRenderer, but how can I do this?

One of the features of sourceopt extension available in official extension repository is the possibility to remove the generator meta. Just install it with Extension Manager in the backend, then enable with these lines in the Setup field of your TypoScript template probably on the root page (optionally after including extensions TS in your template go to Constants editor to click the options):
config.sourceopt.enabled = 1
config.sourceopt.removeGenerator = 1
Bonus tip: check the extension's manual for more options like removing comments or formatting/minimizing output HTML.

Related

Where can we find the Spartacus OOTB Component HTML's

For the available existing OOTB Spartacus Component's in Cart, PLP, PDP or Checkout pages, where we can get see the list component HTML's and Stylings used.?
Let's use one example for illustration. Say if you want to explore the html implementation of component named "UnitDetailsComponent", just search it in github repository: https://github.com/SAP/spartacus/search?q=UnitDetailsComponent
Then you can find its path in project: feature-libs\organization\administration\components\unit\details\unit-details.component.ts
With this path you can find its html implementation: feature-libs\organization\administration\components\unit\details\unit-details.component.html
Best regards,
Jerry
We used to have a documentation link but since a week it giving 404(link).
The Spartacus repo is public so you can clone and see components and styles there - repo.
You can see the documentation to see how to override components and also to customise OOTB components - docs.

Adding custom style in Ckeditor 5

I am trying to find an answer several days but not able to.
How can I add custom styles just like in Ckeditor 4 (For example, using CKEDITOR.stylesSet.add) ?
Thanks
Edit the CkEditor css file in its entirety, that can be found at This guide
From the page:
By default, content styles are loaded by the editor JavaScript which makes them only present
when users edit their content and this, in turn, usually takes place in the back–end of an application. If you want to use the same styles in the front–end, you may find yourself in a situation that requires you to load CKEditor just for that purpose, which is (performance–wise) not the best idea.
To avoid unnecessary dependencies in your front–end, use a stylesheet with a complete list of CKEditor 5 content styles used by all editor features. There are two ways to obtain it:
By taking it directly from this guide and saving it as a static resource in your application (e.g. content-styles.css) (recommended).
By generating it using a dedicated script. Learn more in the Development environment guide.
Load the content-styles.css file in your application by adding the following code to the template:

Is it possible to generate css files using emotion?

emotion is a css-in-js library. I saw it created <style> tag in the html head to provide styles.
Is it possible to use emotion to generate separate css files? So that we can move them to CDN and make the app loading faster.
according to Docs, you can't do it.
The way I used to generate an external stylesheet was to load my pages with SSR, and take the css generated by extractCritical, then write it to a file by using fs within style tag.

Stencil - How are new fonts added?

How or where is this variable defined in stencil?
{{ getFontsCollection }}
I'm hoping to include other google fonts in the theme. Are they automatically included if they are listed in schema.json?
According to the Stencil Docs, getFontsCollection is a handlebars injection helper function used to help you load the resource on the page:
{{getFontsCollection}}
The getFontsCollection helper is custom to Stencil. It returns a link tag that loads all selected font collections. It takes no parameters.
The helper method pulls from your global getThemeSettings() which are located in your config.json file. Look for the primary-font and secondary-font fields
"settings": {
"primary-font": "Google_Lato_700,400,300",
"secondary-font": "Google_Droid+Serif_400italic,400,700",
...
}
They are added via the config file

dojo internalize html templates

When using filter and pagination plugins for EnhancedGrid, the HTML templates for the same are loaded from dojox\grid\enhanced\templates.
Is there any way by which I can avoid the server requests for these HTML files by making them part of the Enhanced Grid's inline javascript?
You should make a custom dojo build that creates one js file as a result. follow this instructions from a previous QA:
How to build Dojo into a single file, given a list of dependencies?
EDIT:
The build should add those html files inline, but doesn't. I googled a bit and found this link related to your problem:
http://grokbase.com/t/dojo/dojo-interest/121e536t64/enhancedgrid-filter-problem
It suggests a fix using this link
http://dojo-toolkit.33424.n3.nabble.com/Custom-build-including-CSS-and-HTML-files-td3536573.html
Citation:
If you are using the AMD style of module definition, then you can specify a text dependency like so:
define(["dojo/text!some/file.html", "other/module"],
function(template, otherModule){
...
// to use the contents of the html file, treat template as if it were a normal string
someNode.innerHTML = template;
...
});
The build system should automatically convert the text dependency to an inline string literal. Most Dojo files are already formatted to use this feature, but I can't account for dojox modules. I'm not sure whether similar functionality is possible with the dojo.require/dojo.provide system of dependency declaration.
I have got the solution. Those struglling from this issue pls. note that there is bug with Dojo 1.7.1 and we need to use Dojo 1.8.3 and use internStrings option with the build command. You should see HTML files being interned in the build-report.