https://github.com/creative-workflow/lib-divi
Make Divi-Wordpress-Theme module development smart for developers.
https://github.com/creative-workflow/lib-divi
Last synced: 8 months ago
JSON representation
Make Divi-Wordpress-Theme module development smart for developers.
- Host: GitHub
- URL: https://github.com/creative-workflow/lib-divi
- Owner: creative-workflow
- License: mit
- Created: 2017-11-15T12:05:16.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-04-04T12:54:28.000Z (about 4 years ago)
- Last Synced: 2025-09-22T22:24:09.491Z (8 months ago)
- Language: PHP
- Homepage:
- Size: 55.7 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# creative-workflow/lib-divi
Make Divi module development smart for developers. See module implemenatation here: https://github.com/creative-workflow/wordpress-divi-child-modules/blob/master/hello-world/Module.php
### Setup
```
bower install --save creative-workflow.sass
bower install --save creative-workflow.php
bower install --save creative-workflow.wordpress
bower install --save creative-workflow.divi
or
composer require creative-workflow/sass
composer require creative-workflow/php
composer require creative-workflow/wordpress
composer require creative-workflow/divi
or
git submodule add https://github.com/creative-workflow/lib-divi.git ./wordpress/wp-content/themes/child/lib/cw/divi
git submodule add https://github.com/creative-workflow/lib-wordpress.git ./wordpress/wp-content/themes/child/lib/cw/wp
git submodule add https://github.com/creative-workflow/lib-php.git ./wordpress/wp-content/themes/child/lib/cw/php
git submodule add https://github.com/creative-workflow/lib-sass.git ./wordpress/wp-content/themes/child/lib/cw/sass
git submodule init && git submodule update
git submodule foreach git checkout master
```
### Helper
```php
addDefaultFields();
$group = $this->addGroup('main_module', 'Main')
->tabGeneral();
$group->addField('headline')
->label('Überschrift')
->typeText('Überschrift')
->addFontSettings('.module-headline');
$group->addField('headline_tag')
->label('Überschrift-Tag')
->typeSelect([
'h1' => 'h1',
'h2' => 'h2',
'h3' => 'h3',
'h4' => 'h4',
'h5' => 'h5',
'h6' => 'h6',
'strong' => 'strong',
'b' => 'b',
'div' => 'div'
]);
$group->addField('text')
->label('Text')
->typeHtml()
->addFontSettings('.text');
$group->addField('image')
->label('Bild')
->typeUpload()
->description('Geben Sie ein Bild an!')
->basicOption();
return $this;
}
public function callback( $atts, $content = null, $function_name ) {
$variables = $this->props;
$variables['text'] = $this->content;
return $this->renderModule(
'views/module.php',
$variables
);
}
}
new ModuleTherapyMethod(__DIR__);
```
##### hallo-world/views/module.php
```php
= $this->tag($headline_tag, $headline, ['class' => 'module-headline']) ?>
= $text ?>
if($image)
echo $this->image($image, ['class' => 'image']);
?>
```
##### hallo-world/css/module.sass
```sass
@import "variables"
@import "mixins/css/css3"
@import "mixins/css/positioning"
@import "mixins/helper/helper"
@import "mixins/grid/mediaqueries"
@import "mixins/grid/grid"
@import "mixins/wordpress/divi"
@import "mixins/wordpress/post"
+custom-divi-module('cw-module-hallo-world')
.image
display: none
+min-width-sm
+block
+absolute
right: -40px
bottom: 0
.content-wrapper
[...]
```