# Customize a widget

Usually the HTML structure in wireframe mode is not optimize for a real integration. Minotaure plans a complete widget cloning.

You may not need all files from a widget, maybe you only want to customize de front view. See the complete list of command line here

# Cloning a widget

In this exemple, we are going to create a complete clone of news.

Go to minotaure-theme and run

composer clone basic news all
1

This command line will create 2 folders if basic was not yet created and 3 files :

├──minotaure-theme
|  ├──widgets
|  |  ├──basic
|  |  |  ├── news
|  |  |  |   └── Register.php
|  |  |  |   └── m_form.twig
|  |  |  |   └── m_widget.twig
1
2
3
4
5
6
7

# what has been changed?

As you can see in Register.php, the namespace has changed. A namespace\class must be unique.

#original
namespace Be\Minotaure\Widgets\Basic\News;

#clone
namespace Widgets\Basic\News;
1
2
3
4
5

Minotaure need to make some difference between an original widget and a clone. All helpers and function are the same but namespace and views file name must be change.

#original
form.twig
widget.twig

#clone
m_form.twig
m_widget.twig
1
2
3
4
5
6
7

In this file you can add and remove all inputs but do not forget to add/remove them in m_form.php and m_widget.php

Last Updated: 4/10/2020, 12:58:42 PM