Migration
From the Semantilizer (z7_semantilizer)
The Semantilizer keeps the type of a header in one field, header_ (0 to 6), and leaves header_ for the look.
Headliner does the same with two fields, header_ for the tag and header_ for the look, so the content can be
taken over.
Important
Do not run both extensions side by side. Both override the header partial of fluid_, and the
Semantilizer's partial wins, so the tags of headliner would have no effect in the frontend and the editor would see two
fields for the same thing. Headliner therefore conflicts with zeroseven/ in Composer. The order is:
remove the Semantilizer, install headliner, run the wizard. The wizard does not need the Semantilizer: it reads the
column header_, which stays in the database.
Warning
Removing the Semantilizer does not delete its column header_, but a destructive schema update does. Until the
wizard has run, that column is the only place where the heading types are stored. In this order:
- Make a backup of the database.
- Make sure nothing runs a destructive schema update:
typo3 database:without an argument (or withupdateschema safe) only adds and changes fields, whiledestructive,"*",field.ordrop table., and the entries to remove unused fields in Analyze Database Structure, delete the column. Look at the deployment script, too.drop - Remove the Semantilizer, install headliner and run the wizard (below).
- Check the result, and only then delete the unused column
header_, if you want to.type
The values cannot be taken over once the column is gone: they can then only be restored from the backup.
The upgrade wizard Headliner: take the heading types of the Semantilizer (z7_semantilizer) into the tags of headliner does that:
vendor/bin/typo3 upgrade:run headlinerMigrateSemantilizerFields
You can also run it in Admin Tools > Upgrade > Upgrade Wizard. It is listed when the column header_ is
still in the database and there is something to change.
header_ |
header_ |
|---|---|
| 1 to 6 | h1 to h6 |
| 0 (none) | div, like the Semantilizer, which renders every other value as a div |
- The layout (
header_) is the same field in both extensions and is not changed.layout - The Semantilizer has no field for the subheader (it renders it one level below its header), so there is nothing to take over and the subheader is not touched.
- It fills only what is empty, which is what
header_is until somebody chooses a tag. A tag that somebody has chosen since headliner was installed is kept, also an H2.tag - Run the wizard right after the Semantilizer was replaced. The column
header_has the default 2 and is no longer maintained once the Semantilizer is gone, so an element that is created afterwards hastype header_2 and no tag of headliner yet: a late run would turn it into antype h2instead of taking its tag from the layout. - The wizard works on the column
header_of the database. That stays after the Semantilizer is removed, until the unused columns are deleted (Analyze Database Structure), so run the wizard before that.type - It can run again, and changes nothing the second time.
What is left to do by hand:
- Remove the Semantilizer (
composer remove zeroseven/) and add the site setz7- semantilizer twtgroup/of headliner, then clear the caches (see Installation).headliner - Change the templates that use
<semantilizer:toheadline> <headliner:(see Your own templates). The simplest isheadline> record="({record}" record="for the subheader): the tag, the layout and the mark for the page module come from the record. With the values it is{record}" subheader="1" <headliner:instead ofheadline. values tag=" {data. header_ tag}"> type=", and{data. header_ type}" edit="tt_if the page module is to change the tag.content: {data. uid}: header_ tag" - Check the CSS: headliner puts the class
ce-on a header, the Semantilizerheadline- layout- N ce__.header-- N
Finding the headings in your templates
The command headliner: lists the headings (h1 to h6) in the Fluid templates of a project and says
which of them headliner: can replace. It only reads: no template is changed.
vendor/bin/typo3 headliner:scan-templates # the whole project
vendor/bin/typo3 headliner:scan-templates packages/site # one directory
vendor/bin/typo3 headliner:scan-templates --with-static # also the headings with a fixed text
vendor/bin/typo3 headliner:scan-templates --with-backend # also the templates of the backend
vendor/bin/typo3 headliner:scan-templates --exclude=app/public/typo3conf/ext --exclude=packages/legacy
Every heading is listed with its file and line. The scanner gives a replacement only where it is sure: a heading whose
whole text is {record -> f: (the variable is named, and f: takes a record
object only) gets <headliner:, with text for another field and
subheader="1" for the subheader. The output shows the element as it is in the template (-) and the call that replaces
it (+). The attributes of the heading (a class, an id) go on in the call: the ViewHelper is a tag and adds its own layout
class to yours. The tag of the template becomes the default. Under the list, the output says once what is true for
every replacement: the tag follows header_ and header_ of the record when it has one, a subheader gets its
tag from subheader_ or one level below its header, and a record without text gives no heading.
Everything else is listed as needing a decision, with no call, because the scanner would have to guess. The decisions are grouped by the reason, and every place keeps its file and line:
- a translation (
f:),translate - a field of
dataorrecordread as a plain value ({data.): only if that variable is a record object (a Content Block,header} {record}influid_) canstyled_ content headliner:replace it, in a template where it is an array (headline {data}influid_, in TYPO3 12 also in a Content Block) it cannot, and the scanner cannot see which it is,styled_ content - a field of the record with its own formatting (
f:,format. strip Tags raw,nl2br):headliner:outputs the text withheadline f:, which is not the same, so check it by hand,render. text - another value with its own formatting,
- a link, a condition or another markup in the heading,
- a text from a partial,
- a single variable that is no record (the data of a plugin, a setting),
- a heading whose attributes are no
name="value"pairs (an inline condition in the tag, an attribute without a value): they cannot go into the call, so there is none, - several variables or a text.
A component that chooses its tag with an f: (one <h1> to <h6> with the same text and attributes, in f:
blocks) is listed once, as a component, with the number of headings. The scanner reads the switch and the heading in each
case, the default case included. If the value of every f: is the number of its heading (1 for h1), one
headliner: (with the variable of the switch) replaces the headings; if it is the tag itself
(h1), it is tag=". A default case that is a <div> becomes default="div" of the call (a value that is no tag
gives a div in the switch, and an h2 in the call without it). If it is neither (the value 2 gives an h3, a default case gives an h4), there is no call, and the
output names the mapping. In every case it names the other cases of the switch (a <p>, a case that hides the header, the
default case that is no <div>), which the call does not replace, and it gives no call if the headings are in different or nested switches.
The templates of the backend (the preview of a Content Block, backend-, and Resources/) are
not on the page, so they are only counted; -- lists them.
-- takes a path relative to the scanned directory (a directory or a file) and can be given more than once. Use it
for code that is not yours: in a project where the extensions are installed into typo3conf/, the scanner cannot tell
yours from the installed ones, so it lists them all.
A heading with the text of a page ({page -> f:) is listed as needing a decision: a page has
no field for a tag, so there is no headliner: for it that the page module could change.
The scanner skips comments, HTML files without Fluid, and the directories vendor, node_, var, .Build,
typo3temp, sysext and _assets. For a template that has an array, not a record object, see
headliner:headline.row and headliner:headline.values.
Note
The scanner is a helper, not a guarantee. It reads the markup with patterns, so it can miss a heading (one that is built by a partial, a ViewHelper or another extension). It gives a call only where the markup leaves no doubt, but it does not see the rest of the project: headliner needs TYPO3 14.3, and the scanner does not look at the version of the project. Check every suggestion, and the rendered page, before you change a template.