Save
This commit is contained in:
@@ -12,4 +12,48 @@
|
||||
max-width: 20px;
|
||||
height: auto;
|
||||
max-height: 12px;
|
||||
}
|
||||
|
||||
.elementor-widget-acf-product-parameters .product-parameters {
|
||||
padding: 30px;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
border: 1px solid rgba(20, 24, 62, 0.0588235294);
|
||||
}
|
||||
.elementor-widget-acf-product-parameters .product-parameters li {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
-moz-column-gap: 20px;
|
||||
column-gap: 20px;
|
||||
}
|
||||
.elementor-widget-acf-product-parameters .product-parameters li:not(:last-child) {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.elementor-widget-acf-product-parameters .product-parameters li .product-parameters__img {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.elementor-widget-acf-product-parameters .product-parameters li .product-parameters__img img {
|
||||
width: 100%;
|
||||
max-width: 50px;
|
||||
-o-object-fit: contain;
|
||||
object-fit: contain;
|
||||
}
|
||||
.elementor-widget-acf-product-parameters .product-parameters li .product-parameters__content .product-parameters__title {
|
||||
font-size: 16px;
|
||||
font-family: "Open Sans", sans-serif;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
margin: 0 0 5px 0;
|
||||
}
|
||||
.elementor-widget-acf-product-parameters .product-parameters li .product-parameters__content .product-parameters__title a {
|
||||
color: var(--e-global-color-accent);
|
||||
}
|
||||
.elementor-widget-acf-product-parameters .product-parameters li .product-parameters__content .product-parameters__description {
|
||||
font-size: 16px;
|
||||
font-family: "Open Sans", sans-serif;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
margin: 0;
|
||||
}/*# sourceMappingURL=main.css.map */
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sources":["main.scss","main.css"],"names":[],"mappings":"AACC;EACC,UAAA;EACA,SAAA;EACA,gBAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,QAAA;ACAF;ADGG;EACC,WAAA;EACA,eAAA;EACA,YAAA;EACA,gBAAA;ACDJ","file":"main.css"}
|
||||
{"version":3,"sources":["main.scss","main.css"],"names":[],"mappings":"AACC;EACC,UAAA;EACA,SAAA;EACA,gBAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,QAAA;ACAF;ADGG;EACC,WAAA;EACA,eAAA;EACA,YAAA;EACA,gBAAA;ACDJ;;ADQC;EACC,aAAA;EACA,SAAA;EACA,gBAAA;EACA,gDAAA;ACLF;ADOE;EACC,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,qBAAA;OAAA,gBAAA;ACLH;ADOG;EACC,mBAAA;ACLJ;ADQG;EACC,aAAA;EACA,mBAAA;ACNJ;ADQI;EACC,WAAA;EACA,eAAA;EACA,sBAAA;KAAA,mBAAA;ACNL;ADUI;EACC,eAAA;EACA,oCAAA;EACA,gBAAA;EACA,cAAA;EACA,iBAAA;ACRL;ADUK;EACC,mCAAA;ACRN;ADWI;EACC,eAAA;EACA,oCAAA;EACA,gBAAA;EACA,cAAA;EACA,SAAA;ACTL","file":"main.css"}
|
||||
@@ -18,3 +18,54 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.elementor-widget-acf-product-parameters {
|
||||
.product-parameters {
|
||||
padding: 30px;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
border: 1px solid #14183e0f;
|
||||
|
||||
li {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
column-gap: 20px;
|
||||
|
||||
&:not(:last-child) {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.product-parameters__img {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
max-width: 50px;
|
||||
object-fit: contain;
|
||||
}
|
||||
}
|
||||
.product-parameters__content {
|
||||
.product-parameters__title {
|
||||
font-size: 16px;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
margin: 0 0 5px 0;
|
||||
|
||||
a {
|
||||
color: var(--e-global-color-accent);
|
||||
}
|
||||
}
|
||||
.product-parameters__description {
|
||||
font-size: 16px;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,10 @@
|
||||
function register_hello_world_widget( $widgets_manager ) {
|
||||
|
||||
require_once( __DIR__ . '/widgets/images-list.php' );
|
||||
require_once( __DIR__ . '/widgets/acf-product-parameters.php' );
|
||||
|
||||
$widgets_manager->register( new \Elementor_Images_List() );
|
||||
$widgets_manager->register( new \Elementor_ACF_Product_Parameters() );
|
||||
}
|
||||
add_action( 'elementor/widgets/register', 'register_hello_world_widget' );
|
||||
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use Elementor\Controls_Manager;
|
||||
use Elementor\Icons_Manager;
|
||||
use Elementor\Repeater;
|
||||
use Elementor\Utils;
|
||||
|
||||
class Elementor_ACF_Product_Parameters extends \Elementor\Widget_Base {
|
||||
|
||||
public function get_name() {
|
||||
return 'acf-product-parameters';
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__('ACF Product Parameters', 'elementor-addon');
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'eicon-code';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return ['basic'];
|
||||
}
|
||||
|
||||
public function get_keywords() {
|
||||
return ['global', 'login'];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$this->start_controls_section(
|
||||
'list_section',
|
||||
[
|
||||
'label' => esc_html__('List', 'elementor-addon'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
$settings = $this->get_settings_for_display();
|
||||
$acf_product_parameters = get_field('parametry_produktu');
|
||||
|
||||
if (empty($acf_product_parameters)) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<ul class="product-parameters">
|
||||
<?php foreach ($acf_product_parameters as $parameter) : ?>
|
||||
<li>
|
||||
<div class="product-parameters__img">
|
||||
<img src="<?php echo $parameter['obrazek']; ?>" alt="">
|
||||
</div>
|
||||
<div class="product-parameters__content">
|
||||
<? if ($parameter['link']) : ?>
|
||||
<p class="product-parameters__title">
|
||||
<a href="<?php echo $parameter['link']['url']; ?>" <?php if ($parameter['link']['target']) : ?>target="_blank"<?php endif; ?>>
|
||||
<?php echo $parameter['tytul']; ?>
|
||||
</a>
|
||||
</p>
|
||||
<? else : ?>
|
||||
<p class="product-parameters__title">
|
||||
<?php echo $parameter['tytul']; ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<p class="product-parameters__description">
|
||||
<?php echo $parameter['tekst']; ?>
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user