# FAQ

# How do I create my own CMS element?

You can read how to create your own CMS element here.

# Copy elements

Show Answer

It is possible to copy elements from one plugin to another.

# Example

For example, you want to copy the Jumbotron element from the demo plugin to your own plugin or custom theme.

  • Copy the folder jumbotron from custom/plugins/NetiNextCmsElementBuilderDemo/src/Resources/neti_cms_elements/ including the two files into your Plugin / CustomTheme under the path custom/plugins/DEINPLUGIN/src/Resources/neti_cms_elements/.
  • Upload the data to the server
  • Under "Contents > CMS Elements" click on "Synchronise": Sync Button
  • Now the new element is displayed.

Element is not displayed

If the element is not displayed, check the composer.json of your plugin or custom theme plugin:

"require": {
    "netinventors/next-cms-element-builder": ">=4"
},
1
2
3

is deposited.

# What happens if a CMS element is no longer available?

Show answer

It can happen that CMS elements are no longer available if, for example, the plugin in which the CMS element is stored is deactivated or uninstalled. uninstalled, in which the CMS element is stored.

So if this happens, the experience that uses the CMS element will probably no longer work properly in the administration and will probably be displayed incorrectly in the storefront. in the administration and will probably be displayed incorrectly in the storefront.

We have provided a function that detects these sources of error and offers you the possibility to offers you the possibility to delete defective references.

You can do this under "Content > CMS Elements" (see screenshot).

Lookup References

By clicking on the button "Check references", all worlds of experience are searched for defective references. and then the result is clearly displayed.

Lookup References Result

Here you can delete the references individually or all of them. Please note that when deleting the reference, the CMS element is completely deleted from the world of experience, and this may lead to unwanted if the CMS element is available again at a later date.

# How are CMS elements registered?

Show Answer

Again, there are various possibilities.

Basically, when a plug-in is installed / activated / updated, a check is carried out in the respective plug-in directory to see whether CMS elements are stored there and are automatically registered in the system. If a plugin is deactivated or uninstalled, the CMS elements that were registered by the plugin are deactivated.

Deactivated CMS elements are no longer available in the administration.

Another possibility is a console command:

bin/console neti:ceb:sync:elements
1

Of course, we also thought of providing a possibility in the administration. After the successful the administration will be reloaded in order to have new CMS elements available directly in the administration. available directly in the administration.

Sync Button

# No plugin can be selected for saving

Show answer

For security reasons, only plugins that have a requirement on CmsElementBuilder plugin are displayed. To do this, adapt the composer.json file in your plugin or theme and add to it:

"require": {
    "netinventors/next-cms-element-builder": ">=4"
},
1
2
3

and

"extra": {
    "netinventors": {
        "NetiNextCmsElementBuilder": {
            "config": {
                "writeAccess": true
            }
        }
    }
}
1
2
3
4
5
6
7
8
9

If the configuration "writeAccess" is missing: true or is "false", only elements can be read but none can be written from the plug-in.

# Why do you need plugin(s) for the CMS elements?

Show Answer

The files of the CMS element should always be saved in a separate plugin or in the custom theme plugin. This prevents the CMS element (or its files) from being lost during a plugin update. When updating the plugin, the physical files of the plugin are deleted from Shopware, the new plugin package is downloaded and unpacked into the plugin folder of Shopware. This means that the files for the CMS element are also deleted - if they were in the plugin folder.

The advantage of having your own plugin is that it can be versioned and used in other projects.

Best Practice

Save the data in the custom theme plugin used.