Giter VIP home page Giter VIP logo

sf_tv2fluidge's Introduction

Project Status: Inactive – The project has reached a stable, usable state but is no longer being actively developed; support/maintenance will be provided as time allows.

TemplaVoila migration to Fluidtemplate and Grid Element

What is it?

A TYPO3 Extension with tools that can be helpful when migrating an existing TYPO3 website made with TemplaVoila to Fluidtemplate and Grid Elements

Included modules

  • Module to mark all unreferenced elements as deleted
  • Module to convert references to "insert records" elements
  • Module to migrate the content of a flexible content element to a Grid Element
  • Module to migrate content from TemplaVoila columns to Fluidtemplate columns
  • Module to convert GridElements where the language is set to "all languages"
  • Module to fix the sorting of translated content elements

Who should use it?

This extension should be used by TYPO3 integrators with good knowledge of TemplaVoila, Fluidtemplates, Grid Elements and TypoScript.

Prerequisites

  • A full backup of your TYPO3 website (database and files)!
  • TemplaVoila version 1.8+ installed and with old page module enabled
  • ExtBase and Fluid installed
  • Grid Elements installed (please ignore conflict with TemplaVoila!)

Extension settings

The following settings are available in the extension settings.

rootPid

If this field is set to a valid PID from the page tree, only this page and all subpages will be included during all migration steps.

Default value: empty

includeNonRootPages

Only respected, when rootPid is empty. If set, also non root pages are selected from the pagetree when the extension selects TYPO3 pages to be included in the migration.

Default value: off

pagesDepthLimit

The page depth limit for fetching subpages from the pagetree when the extension selects TYPO3 pages to be included in the migration process.

Default value: 99

Migration steps in short

  1. Create Grid Elements for all Flexible Content Elements you wish to migrate
  2. Create backend layouts and Fluidtemplates for all TemplaVoila page templates you wish to migrate
  3. Delete all unreferenced elements
  4. Convert references to "insert records" elements
  5. Delete all unreferenced elements (conversion of references to FCE elements to insert records creates new unreferenced elements)
  6. Migrate all Flexible Content Elements to Grid Elements
  7. Migrate all TemplaVoila page templates to Fluidtemplate
  8. Delete TemplaVoila-Folder General Record Storage Page from root page
  9. Remove TemplaVoila
  10. Optionally convert GridElements with "all languages"
  11. Optionally fix the sorting of translated content elements

Delete unreferenced elements

Many users working with TemplaVoila think, that the "unlink" function for content elements deletes the desired content elements. Actually, the content element only gets unlinked from the TemplaVoila layout and persists on the page. On the TemplaVoila tab "Non-used elements" all content elements are shown which that are not linked on the actual page.

When migrating a TYPO3 website from TemplaVoila to Fluidtemplate, all unreferenced elements should be deleted, since they are not shown on the output page. You can use this module to perform this action.

The action can safely be used, since it only flags all unreferenced elements as deleted.

Convert references to "insert records" elements

This module searches recursive on all pages for TemplaVoila reference elements and converts them to "insert records" elements.

This module replaces the setting "Create shortcut element for TV references" which was an optional setting in tv2fluidge < version 0.4.x.

You should use this module before you start with migration of Flexible Content Elements and page content.

Migrate FCE

FCE migration module

This module migrates content from a Flexible Content Element to an existing Grid Element. If the Flexible Content Element contains content columns, they can be remapped to content columns of the target Grid Element.

Prerequisites

Before you can start with the migration, you must create a Grid Element for each Flexible Content Element you wish to migrate. If your Flexible Content Element contains JavaScript, you should include this somewhere in you page TypoScript or Grid Element TypoScript.

Flexible Content Elements with content columns only

If your Flexible Content Element only constists of content columns (e.g. 2 column FCE), you should create a new Grid Element with number of content columns from your Flexible Content Element

Flexible Content Elements with flexform only

If your Flexible Content Element only constists of flexform fields (input, images, TypoScript, ...), you should create a new Grid Element and insert the flexform XML from the Flexible Content Element in the Grid Element.

When creating the TypoScript for the new Grid Element, you can use field:flexform_ to get the flexform values.

Example:

20 = TEXT
20.data = field:flexform_myfieldname

Flexible Content Elements with mixed flexform and content columns

If your Flexible Content Element contains a mix of content columns and flexform, you should create a new Grid Element and and insert the flexform XML from the Flexible Content Element in the Grid Element.

Then setup the Grid Element like shown in the below.

Example:

1 <  lib.gridelements.defaultGridSetup
1 {
    columns {
      # colPos ID
      0 < .default
      0.wrap = <div class="content">|</div>
    }
    wrap.stdWrap.cObject = COA
    wrap.stdWrap.cObject {
      10 = TEXT
      10.data = field:flexform_myfieldname
    }
  }

Migrating a Flexible Content Element

To migrate a Flexible Content Element, just select it from the "Flexible Content Element" select box in the module. Next you must select a target Grid Element in the "Grid Element" select box.

If your Flexible Content Element contains content columns, then you can remap them to content columns in the target Grid Element.

How does the migration work?

The FCE migration module finds all Flexible Content Elements of the selected type, changes the content type to GridElement and sets the selected backend layout for the Grid Element. Then it copies the content from tx_templavoila_flex to pi_flexform. If the selected Flexible Content Element has content columns, then all content elements will be mapped to the selected content columns of the target Grid Element.

Migrate content

Content migration module

This module migrates content from TemplaVoila content columns to backend layout content columns based on Fluidtemplate. After the content migration, the selected backend layout gets assigned to the "Backend Layout" select boxes.

It also migrates flexform fields (e.g. textfields or images, which are used in your frontend output). The flexform fields will be migrated to the Database fields, if those fields exist. If the corresponding field does not exist, they will be ignored.

Prerequisites

Before you can start with the migration, you must create a backend layout and Fluidtemplate for each TemplaVoila page template you wish to migrate.

For TemplaVoila templates with only content columns, you should just create backend layouts and Fluidtemplates with the same amount of content columns. Be sure to set a decent name to each content column, so you later can identify them when remapping from TemplaVoila content columns to backend layout content columns.

It is important to check, that both dropdown boxes for the TemplaVoila Template Design contains a template. So make sure "Use Template Design" and "Subpages - Use Template Design" contains a valid template.

If your TemplaVoila template contains FlexForm fields (e.g. input, images, ...) and you want to keep them then you should create database fields for them (in table "pages" and "pages_language_overlay"). Those fields need to be named as the fields in the FlexForm but can contain a prefix (which can be specified per template).

Migrating content from TemplaVoila

To migrate content from TemplaVoila, just select the TemplaVoila Page Template the "TV Page Template" select box in the module. Next you must select a target backend layout in the "Backend Layout" select box. Finally remap all content columns from the TemplaVoila Page Template to the target content columns of the backend layout.

After content migration, you should not rearrage or create new content elements on pages with a Fluid Template, when TemplaVoila is still installed. TemplaVoila uses a method named correctSortingAndColposFieldsForPage, which may move all content elements to column 0.

How does the migration work?

The content migration module finds all pages with the selected TemplaVoila Page Template and remaps all content elements to the selected target content columns of the backend layout. After the content migration, the selected backend layout gets assigned to the "Backend Layout" select boxes.

Post-process steps

After the content migration, you should check in the TYPO3 backend, that content elements in the page module have the correct ordering. If this is not the case, you have to manually reorder all translated content elements.

Convert GridElements with language set to "all languages"

On multilingual sites made with TemplaVoila you can set the language FCEs to "all languages" and translate multilingual content directly inside the FCE container. Using backend layouts and GridElements this can cause some problems after migrating of a TemplaVoila site with this extension and I would recommend to use a translated Grid Element for each page language.

This converter clones Grid Elements with "all languages" so you have individually translated Grid Elements for each page translation. The conversion process also reassigns all child content elements of the original Grid element to the now translated Grid Element.

Prerequisites

This module should only be used when the following steps are processed:

  • Migration of TemplaVoila Flexible Content Elements to GridElements
  • Migration of content from TemplaVoila to Fluid Template
  • It is recommended to create a backup of your TYPO3 database, so you can easily roll back if the conversion fails

Post-process steps

Atfer the conversion, you should use the module "Fix sorting" to apply the sorting of the original content elements to the translated content elements.

If the original Flexible Content Elements used flexform fields (e.g. textfields or imagefields), the migration will also modified the FlexForm to use lDEF and vDEF only, so one has to set <langDisable>1</langDisable> to the flexform of your GridElement

Also check, if you have content, which does not have a default language. In this case, your TypoScript Setup should not contain sys_language_overlay = hideNonTranslated Or in TYPO3 v6.2 one can keep this setting but also needs to use the new TypoScript option: select.includeRecordsWithoutDefaultTranslation, see http://docs.typo3.org/typo3cms/TyposcriptReference/Functions/Select/Index.html

If css_styled_content is used this option could be used the following way:

styles.content.get.select.includeRecordsWithoutDefaultTranslation = 1
styles.content.getLeft.select.includeRecordsWithoutDefaultTranslation = 1
styles.content.getRight.select.includeRecordsWithoutDefaultTranslation = 1
styles.content.getBorder.select.includeRecordsWithoutDefaultTranslation = 1

Fix sorting of translated content elements

Fix sorting module

You should only use this module, if the sorting of content elements after the migration is different to the original state.

This module sets the sorting to all translated content elements, so it will be the same as for the original content element.

Prerequisites

This module should only be used when the following steps are processed:

  • Migration of TemplaVoila Flexible Content Elements to GridElements
  • Migration of content from TemplaVoila to Fluid Template
  • Conversion of Grid Elements with language set to "all languages"
  • It is recommended to create a backup of your TYPO3 database, so you can easily roll back if the result is not as expected

Feedback and updates

The extension is hosted on GitHub. Please report feedback, bugs and changerequests directly at https://github.com/derhansen/sf_tv2fluidge

TYPO3 7.6 LTS support

At the time of writing, there is no fully working version of TemplaVoila available for TYPO3 7.6 LTS. If you plan to migrate to Fluidtemplate and Gridelements using sf_tv2fluidge, I recommend to do the migration before the TYPO3 6.2 -> 7.6 core update.

sf_tv2fluidge's People

Contributors

bunnyfield avatar coders-care avatar danielsiepmann avatar derhansen avatar leitgab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sf_tv2fluidge's Issues

[TASK] Update documentation about correctSortingAndColposFieldsForPage

correctSortingAndColposFieldsForPage gets called, when TV is still installed. Therefore it is not recommended to update content with the classic page module, because content gets moved to colPos 0 under some circumstances.

@todo: Find out when this happens, update to documentation and describe how to avoud

[BUG] PHP Fatal in Migrate FCE module

PHP Fatal error: Call to a member function xpath() on a non-object in /sf_tv2fluidge/Classes/Service/SharedHelper.php

Root cause for the problem is, that getTvDatastructure only selects data from tx_templavoila_datastructure and does not respect templates in tx_templavoila_tmplobj

New SQL Query should be:

SELECT tx_templavoila_datastructure.title
FROM tx_templavoila_datastructure, tx_templavoila_tmplobj
WHERE tx_templavoila_tmplobj.uid = <given-uid> AND tx_templavoila_tmplobj.datastructure = tx_templavoila_datastructure.uid

[TASK] Add sorting to references

When inserting new references to the database, add ordering depending on content element (if exists) before the new reference.

[FEATURE] Create content migration module

Create a backend module, which allows to migrate content from TemplaVoila content columns to Fluid Backend Layout columns.

Workflow

  • Select source TV template object
  • Check Datastructure from TV template object and extract all content columns
  • Select target Fluid backend layout
  • Extract all content columns
  • User maps TV content column to Fluid content column
  • It must be possible to not select a target column
  • Content element sorting must be kept
  • Action fetches all pages with the selected TV template object, sets the fluid Backend layout (also for subpages if set by TemplaVoila) and migrated the content as configured by the user

[TASK] Create site with usecases

Page Templates

  • 1 Columns
  • 2 Columns
  • 3 Columns

Flexible Content Elements

  • 2 Columns
  • 2 Columns nested
  • With input-fields which outputs an Image rendered with GIFBUILDER
  • Accordion
  • With input-fields and content

Page Content

  • Text
  • Text/Images
  • References to content elements in different columns
  • References to content elements in different columns of flexible content elements

[TASK] Test FCE migration + Grid Elements TS Examples

  • 3 Columns FCE
  • Nested Columns FCE (FCE in FCE)
  • FlexForm only FCE
  • FlexForm and Content FCE

Example - Flexform only

  4 <  lib.gridelements.defaultGridSetup
  4 {
    stdWrap.cObject = COA
    stdWrap.cObject {
      10 = IMAGE
      10.file = GIFBUILDER
      10.file {
        XY = 200,40
        backColor = #999999
        10 = TEXT
        10.text.data = field:flexform_field_gheader
        10.text.case = upper
        10.fontColor = #FFCC00
        10.fontFile =  t3lib/fonts/vera.ttf
        10.niceText = 0
        10.offset = 0,14
        10.fontSize = 14
      }
      20 = TEXT
      20.data = field:flexform_field_text
    }
    wrap = |
  }

Example - Flexform mix

  5 <  lib.gridelements.defaultGridSetup
  5 {
    columns {
      # colPos ID
      0 < .default
      0.wrap = <div class="content">|</div>
    }
    wrap.stdWrap.cObject = COA
    wrap.stdWrap.cObject {
      10 = IMAGE
      10.file = GIFBUILDER
      10.file {
        XY = 200,40
        backColor = #999999
        10 = TEXT
        10.text.data = field:flexform_field_gheader
        10.text.case = upper
        10.fontColor = #FFCC00
        10.fontFile =  t3lib/fonts/vera.ttf
        10.niceText = 0
        10.offset = 0,14
        10.fontSize = 14
      }
      20 = TEXT
      20.data = field:flexform_field_text
    }
  }

[FEATURE] Add converter for multilingual content

Some multilingual sites created with TemplateVoila do have content elements, where the content element language is set to "all". After migrating a website from TemplaVoila to Fluid/GredElements, those content elements do not fit to the traditional column layout.

Create a converter, which takes all content elements with the language setting "all" and create a new content element with the same content/subcontent for all page languages.

Tasks

  1. clone original GE (according to website languages)
  2. set sys_language_uid of original GE to 0 (default)
  3. for each cloned GE
  4. set l18n_parent to UID of original GE
  5. set sys_language_uid for each language
  6. for each tt_content element which is a child of the original GE
  7. check if a tt_content record with a translation exists
  8. set l18n_parent to uid of original content element (if nesceccary)
  9. set colPos to "-1"
  10. set GE container to uid of translated GE
  11. Set GE column to value of original content element

If GridElement contains Flexform, <langDisable>1</langDisable> must be set and manual work is necessary!

sys_language_overlay = hideNonTranslated should be deactivated after conversion if needed (e.g. if you have content which does not have a default translation)

[TASK] Check content PID on migration

For each tt_content element check the PID. If the PID does not match the current PID, then it is a TV reference and we must create an "Insert Record" Record for that tt_content element

[TASK] Create module for multilingual content reordering

Create a module, where the user selects a page or all pages and can apply the ordering of the default language to all translated content elements.

Applies only to pages, where the ordering of content elements are exactly the same for all languages. Therefore give 2 options (individual page / all pages -> Select and Input)

Process

  • Get all content elements for given page with language = 0
  • For each content element get all translated content elements
  • Set ordering to translated content elements to original sorting ( * 100 * languid)

[TASK] Update Documentation

  • Update documentation and describe each module individually
  • Recommendations for FCEs
    • Only content columns -> Grid Element with columns
    • Only input / TS -> Grid Element with FlexForm
    • Mixed input / TS and content colukns -> Grid Element with FlexForm and columns
    • FCEs with references
    • Ordering of content
  • Describe what is not possible to convert
  • Update documentation on each Module page

[TASK] Add check to TV extension config

Best configuration for Content migration

  • enable.oldPageModule = TRUE
  • enable.selectDataStructure = FALSE
  • TV min version 1.8.0

With this configuration, the site admin can see both the TV and Fluid Backend layouts (only on root page with storagePid set)

Todo

  • Re-arranging existing or creating new content elements in a Fluid Template Page is not recommende, when TemplaVoila is still installed. Content will be moved to default column!
  • Check this on other TYPO3 Installations
  • Root cause: correctSortingAndColposFieldsForPage - called by hook in TYPO3 core
  • If converting FCEs to Grid Elements, then both TV and GridElements must be installed. (GridElements conflicts with TV)
  • Grid Elements will not show "Insert Record" references when TemplaVoila is installed. No, Shortcut Records were created wrong

[FEATURE] Extend FCE migration

  • Extend the FCE migration action, so it is possible to remap content columns in FCE to content columns in Grid Elements
  • Some functions from MigrateContentHelper can be outsourced to a shared class

problem with pid of website-root

Deleting unreferenced elements and content migration doesn't work if the pid of the website-root page is other than "1", because it's hardcoded in function getPageIds() in SharedHelper.php.

problem when "Subpages - Use Template Design:" is not set

When "Subpages - Use Template Design:" is not set in web-root page (nonessential for TV), the content migration helper doesn't set the "Backend Layout (subpages of this page)" field. But this field has to be set for correct behaviour.

[TASK] Update documentation about multi language sites

If GridElement contains Flexform, <langDisable>1</langDisable> must be set and manual work is necessary!

sys_language_overlay = hideNonTranslated should be deactivated after conversion if needed (e.g. if you have content which does not have a default translation)

0 flexible content elements have been migrated

Habe für jedes FCE, welches ich migrieren möchte, ein Gridelement angelegt. Ebenso habe ich ein Backend Layout und Fluidtemplate für mein TemplaVoila! Seitentemplate angelegt.
Beim Migrieren eines FCE in ein Gridelement erhalte ich folgende Fehlermeldung:

"Result
0 flexible content elements have been migrated.
0 content elements have been updated."

Bei einem anderen FCE, welches ich migrieren möchte, bleibt die Seite anschließend leer ohne jegliche Fehlermeldung.

Aus der Dokumentation geht nicht hervor, ob die Gridelemente ohne XML-Konfiguration angelegt werden sollen oder mit dem TemplaVoila!-XML des FCE und es dann überschrieben wird.
Beides habe ich ausprobiert. Erhalte aber immer wieder obenstehende Fehlermeldung.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.