Conditional comment in html5-boilerplate or no-js

Hey,
I’m looking for a solution to customize the [html]-Tag.
In <a href: “http://neos.readthedocs.io/en/2.1/CreatingASite/RenderingCustomMarkup/AdjustingOutput.html”>docu-AdjustOutput-section there is a lot of info about elements in head and body.
Unfortunately, I can not deduce how I could use it to do something like this:

<html xmlns="http://www.w3.org/1999/xhtml" lang="en"
      xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers">
<!--[if lt IE 7]><html class="no-js ie ie6 lt-ie9 lt-ie8 lt-ie7" lang="de"> <![endif]-->
<!--[if IE 7]><html class="no-js ie ie7 lt-ie9 lt-ie8" lang="de"> <![endif]-->
<!--[if IE 8]><html class="no-js ie ie8 lt-ie9" lang="de"> <![endif]-->
<!--[if gt IE 8]><!--><html class="no-js" lang="de"> <!--<![endif]-->

Or at least an:

<html class="no-js" lang="de">
...
</html>

for use with Modernizr.

I can’t find the Logic in Source Code for NodeType Page.
Only it’s supertype’d from TYPO3.Neos:Document. To search in Code for Page- or Document-Class or -Nodetype or something like this… to many matches :dizzy_face:

Tried to overwrite the Page NodeType with:

prototype(TYPO3.Neos.NodeTypes:Page){
    attributes.class = "no-js"
}
# other try:
prototype(TYPO3.Neos.NodeTypes:Page){
    class = "no-js"
}

both without success …

What is the easiest solution to

  • use conditional in [html]-Tag?
  • work with modernizr’s no-js ?
  • find other options/attributes usable with NodeType Page?

Have a look at how the Page node type is configured/constructed and you should be able to figure it out…

https://github.com/neos/neos/blob/master/Resources/Private/TypoScript/Prototypes/Page.ts2#L10

1 Like

Hi,
the Reference is quite good, if I would know what I’m have to looking for :tada:.

I found by chance two of the three answers in the sourceCode, although I was looking for something total different :cry:. And as I knew, what particular term («htmlTag») is covering my question, Google has also found something finite:
First match bingo: http://neos.readthedocs.io/en/1.1/Appendixes/NeosTypoScriptReference.html#page
My solution for class=“no-js”

prototype(TYPO3.Neos:Page){
    htmlTag.attributes.class = htmlTag.attributes.class != '' && htmlTag.attributes.class != null ? htmlTag.attributes.class + ' no-js' : 'no-js'
}

I’m not sure if I really have to check the current value of the class attribute. But better safe than sorry. Maybe someone else could give me an advise on the need for?

Answer on third question: Classes or Prototype-Definition to know what other attributes/elements are possible: (Perhaps others have as much as I trouble to tease out the right terms/places from the reference)

So far no answer found for question 2 :
How I could use conditional comments or something similar in -Tag in Neos CMS?

Hey @aertmann,
same second :sunny: posted…
Thank you. I will study the code more deeper. Maybe I will found also an answer for conditional stuff…

Thanks!!