Skip to content
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

Where is the content of CMS pages / static blocks, created before installing the extension? #43

Open
Eddcapone opened this issue Feb 3, 2020 · 2 comments · May be fixed by #48
Open

Comments

@Eddcapone
Copy link

I installed the extension and tried to edit a page, but I noticed that my old HTML is not there anymore? Is this extension only made for completly fresh Magento shops?

@Eddcapone Eddcapone changed the title Where is the content of CMS pages / static blocks created before installing the extension? Where is the content of CMS pages / static blocks, created before installing the extension? Feb 3, 2020
@indykoning
Copy link

I've got the same issue, what i'm guessing is that the data has to be migrated to the https://github.com/Magenerds/WysiwygWidget extension. When i created a test block before and after installing i noticed what the difference is between the content of the blocks.

Content column Before:

<p>Test 1232433454354353</p>

Content column After:

<div class="pd-row row">
    <div class="pd-col col-md-12">
        {{widget type="Magenerds\WysiwygWidget\Block\Widget\Editor" content="---BASE64---PHA+VGVzdCAxMjMyNDMzNDU0MzU0MzUzPC9wPg=="}}
    </div>
</div>

decoding the base64 reveals PHA+VGVzdCAxMjMyNDMzNDU0MzU0MzUzPC9wPg== is the exact content of the content block before.

There is also a page_designer_json field which also has this widget with the base64 string so it would have to be placed there as well.

{
  "version": "1.0.0",
  "rows": [
    {
      "columns": [
        {
          "gridSize": {
            "md": 12
          },
          "content": "{{widget type=\"Magenerds\\WysiwygWidget\\Block\\Widget\\Editor\" content=\"---BASE64---PHA+VGVzdCAxMjMyNDMzNDU0MzU0MzUzPC9wPg==\"}}",
          "settings": {}
        }
      ],
      "settings": {}
    }
  ]
}

I think it would be a nice feature to add a installData.php which converts these columns to the structure pagedesigner supports. However this would also mean the Wysiwyg widget becomes a requirement.

@indykoning indykoning linked a pull request Aug 7, 2020 that will close this issue
@indykoning
Copy link

indykoning commented Aug 7, 2020

Hi, i've created a script to automatically migrate the content to the PageDesigner format.
You could get the diff from #48 and apply it as a patch or get the file some other way.

If you newly install pageDesigner it should run automatically. If it is already installed you can run it via

magerun2 dev:console "\Magento\Framework\App\ObjectManager::getInstance()->get(Magenerds\PageDesigner\Job\Migration::class)->migrate();"

To change it back to the normal Magento format you can run

magerun2 dev:console "\Magento\Framework\App\ObjectManager::getInstance()->get(Magenerds\PageDesigner\Job\Migration::class)->revert();"

NOTE:
You could lose some data during the revert since it uses the first wysiwyg block to fill the content again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants