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
Every heading is listed with its file and line. A heading whose text is a field of a record
({record -> f:, {data.) gets the ViewHelper that replaces it
(<headliner:, with text for another field and subheader="1" for the subheader).
The attributes of the heading are listed too: a class has to be moved into the template around it or into the CSS,
because the ViewHelper puts the layout class only. A heading with another dynamic text (a translation, a formatted
value, several variables) is listed as needing a decision: there is no record the scanner could name.
The scanner skips comments, HTML files without Fluid, and the directories vendor, node_, var, .Build,
typo3temp, sysext and _assets. The suggestion assumes the variable is a record object; in a template where it is an
array, 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) and it can suggest a call that does not fit (the variable is no record, the heading has markup around the text). Check every suggestion, and the rendered page, before you change a template.