-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TASK] Describe htmlTag_stdWrap for hreflang usage #1332
base: main
Are you sure you want to change the base?
Conversation
See https://review.typo3.org/c/Packages/TYPO3.CMS/+/85049 This documentation should help to allow people to use other custom `<html lang="...">` attribution, which was not clearly enough phrased. We would need a proper documentation entry to properly close the underlying issue.
config.htmlTag_stdWrap.override = <html lang="{siteLanguage:hreflang}"> | ||
config.htmlTag_stdWrap.override.insertData = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of "override" which is a condition (if content is there, or not) I would prefer to use some more basic stdWrap property:
config.htmlTag_stdWrap.override = <html lang="{siteLanguage:hreflang}"> | |
config.htmlTag_stdWrap.override.insertData = 1 | |
config.htmlTag_stdWrap.dataWrap = <html lang="{siteLanguage:hreflang}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got the codelines from Georg Ringer. I know too little of Integration with these codes, I am not sure what the reasoning was to use 'override' here, and if it would have benefits. Are you absolutely sure it would work with a dataWrap and has no side effects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both are not working. My example will append an additional html-tag (which is wrong) and the one from Georg will remove all previously added html attributes and will not set the hreflang from site language. Instead it will show the hreflang from Locale object contained in SiteLanguage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so dump. If you work with:
config.htmlTag.attributes.class = specialHtmlTagClass
the solution from Georg will overwrite everything. So, this attribute is gone in Georgs solution. I remember some special tag properties from TypoScript. I tried with encapseLines
, but as in $content <html lang="en_US">
is no ending <html>
the tags
property can not replace anything.
OK. I tries something very different: externalBlocks
of parseFunc
. It does not work either as HtmlParser_tags does not have stdWrap properties. So, I can also fixAttrib->set with fixed values.
So, currently only replacement
seems to be an option:
config.htmlTag.attributes.garvin = hallo
config.htmlTag_stdWrap.replacement.10 {
search = #lang="(.*?)"#i
replace.dataWrap = lang="{SITE:languages.0.hreflang}"
useRegExp = 1
}
Further problem is, that {siteLanguage:hreflang}
will automatically be redirected into the sub-object Locale
of Language
object. But in Locale object still the original hreflang exists and not the modified version from Site Language object:
So, to get the hreflang property from Site Configuration (without Locale object) is to access all languages and extract the first one. See my example TS from above.
Is there anyone with another idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
override
makes it already clear, that the tag is indeed overridden. If you want to have it fool proof add a comment that it is overriden and you might have to redefine other parameters. I would not use crazy constructs as most ppl hardly understand stdwrap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have created an issue ticket: https://forge.typo3.org/issues/104987
See https://review.typo3.org/c/Packages/TYPO3.CMS/+/85049
This documentation should help to allow people to use other custom
<html lang="...">
attribution, which was not clearly enough phrased. We would need a proper documentation entry to properly close the underlying issue.Releases: main, 12.4