Permalink
Browse files

Simplificada la salida HTML para "Front Page Widgets"

  • Loading branch information...
rogertm committed Jan 14, 2019
1 parent c3ac7ee commit 5a22aa90eabbefaa94c2472ebca7b38b312ed48c
@@ -25,7 +25,7 @@
'<div class="widget-thumbnail"><img src="'. t_em( 'thumbnail_src_'.$widget['name'] ) .'" class="card-img-top" alt="'. sanitize_text_field( t_em( 'headline_'.$widget['name'] ) ) .'"/></div>' : null;
$widget_headline = ( t_em( 'headline_'.$widget['name'] ) ) ?
'<header><h2 class="card-title h4">'. $widget_icon_class . t_em( 'headline_'.$widget['name'] ) .'</h2></header>' : null;
'<h2 class="card-title h4">'. $widget_icon_class . t_em( 'headline_'.$widget['name'] ) .'</h2>' : null;
$widget_content = ( t_em( 'content_'.$widget['name'] ) ) ?
'<div class="front-page-widget-content card-text">'. t_em_wrap_paragraph( do_shortcode( t_em( 'content_'.$widget['name'] ) ) ) .'</div>' : null;
@@ -46,14 +46,14 @@
'<a href="'. $secondary_button_link .'" class="btn btn-secondary secondary-button">
<span class="'.$secondary_link_icon_class.'"></span> <span class="button-text">'. $secondary_link_text .'</span></a>' : null;
$widget_footer = '<footer>'. $primary_button_link_url . ' ' . $secondary_button_link_url .'</footer>';
$widget_footer = '<div>'. $primary_button_link_url . ' ' . $secondary_button_link_url .'</div>';
else :
$widget_footer = null;
endif;
?>
<div id="front-page-widget-<?php echo str_replace( 'text_widget_', '', $widget['name'] ) ?>" class="front-page-widget card">
<?php echo $widget_thumbnail_url; ?>
<div class="front-page-widget-caption card-body">
<div class="card-body">
<?php echo $widget_headline;
echo $widget_content;
echo $widget_footer; ?>
@@ -28,7 +28,7 @@
'<h2 class="featurette-heading">'. $widget_icon_class . t_em( 'headline_'.$widget['name'] ) .'</h2>' : null;
$widget_content = ( t_em( 'content_'.$widget['name'] ) ) ?
'<div class="featurette-content">'. t_em_wrap_paragraph( do_shortcode( t_em( 'content_'.$widget['name'] ) ) ) .'</div>' : null;
'<div class="featurette-body">'. t_em_wrap_paragraph( do_shortcode( t_em( 'content_'.$widget['name'] ) ) ) .'</div>' : null;
$primary_link_text = ( t_em( 'primary_button_text_'.$widget['name'] ) ) ? t_em( 'primary_button_text_'.$widget['name'] ) : null;
$primary_link_icon_class = ( t_em( 'primary_button_icon_class_'.$widget['name'] ) ) ? t_em( 'primary_button_icon_class_'.$widget['name'] ) : null;
@@ -46,14 +46,14 @@
'<a href="'. $secondary_button_link .'" class="btn btn-secondary secondary-button">
<span class="'.$secondary_link_icon_class.'"></span> <span class="button-text">'. $secondary_link_text .'</span></a>' : null;
$widget_footer = '<footer class="featurette-footer">'. $primary_button_link_url . ' ' . $secondary_button_link_url .'</footer>';
$widget_footer = '<div class="featurette-footer">'. $primary_button_link_url . ' ' . $secondary_button_link_url .'</div>';
else :
$widget_footer = null;
endif;
?>
<div id="front-page-widget-<?php echo str_replace( 'text_widget_', '', $widget['name'] ) ?>" class="featurette row mb-5">
<?php echo $widget_thumbnail_url; ?>
<div class="featurette-caption <?php echo t_em_grid( '7' ) ?>">
<div class="<?php echo t_em_grid( '7' ) ?>">
<?php echo $widget_headline;
echo $widget_content;
echo $widget_footer; ?>
@@ -24,13 +24,11 @@
$widget_thumbnail_url = ( t_em( 'thumbnail_src_'.$widget['name'] ) ) ?
'<div class="jumbo-widget-thumbnail mb-3"><img src="'. t_em( 'thumbnail_src_'.$widget['name'] ) .'" alt="'. sanitize_text_field( t_em( 'headline_'.$widget['name'] ) ).'" /></div>' : null;
$h_tag = ( $widget['name'] == 'text_widget_one' ) ? 'h2' : 'h3';
$widget_headline = ( t_em( 'headline_'.$widget['name'] ) ) ?
'<'. $h_tag .' class="jumbo-widget-heading">'. $widget_icon_class . t_em( 'headline_'.$widget['name'] ) .'</'. $h_tag .'>' : '';
'<h2 class="jumbo-widget-heading">'. $widget_icon_class . t_em( 'headline_'.$widget['name'] ) .'</h2>' : '';
$widget_content = ( t_em( 'content_'.$widget['name'] ) ) ?
'<div class="jumbo-widget-content">'. t_em_wrap_paragraph( do_shortcode( t_em( 'content_'.$widget['name'] ) ) ) .'</div>' : '';
'<div class="jumbo-widget-body">'. t_em_wrap_paragraph( do_shortcode( t_em( 'content_'.$widget['name'] ) ) ) .'</div>' : '';
$primary_link_text = ( t_em( 'primary_button_text_'.$widget['name'] ) ) ? t_em( 'primary_button_text_'.$widget['name'] ) : null;
$primary_link_icon_class = ( t_em( 'primary_button_icon_class_'.$widget['name'] ) ) ? t_em( 'primary_button_icon_class_'.$widget['name'] ) : null;
@@ -48,7 +46,7 @@
'<a href="'. $secondary_button_link .'" class="btn btn-secondary">
<span class="'.$secondary_link_icon_class.'"></span> <span class="button-text">'. $secondary_link_text .'</span></a>' : null;
$widget_footer = '<footer class="jumbo-widget-footer">'. $primary_button_link_url . ' ' . $secondary_button_link_url .'</footer>';
$widget_footer = '<div class="jumbo-widget-footer">'. $primary_button_link_url . ' ' . $secondary_button_link_url .'</div>';
else :
$widget_footer = null;
endif;
@@ -59,11 +57,9 @@
<div <?php t_em_breakpoint( $section ); ?>>
<div id="front-page-widget-<?php echo str_replace( 'text_widget_', '', $widget['name'] ) ?>" class="jumbo-widget mb-5 <?php echo $jumbo ?>">
<?php echo $widget_thumbnail_url; ?>
<div class="widget-caption">
<?php echo $widget_headline;
echo $widget_content;
echo $widget_footer; ?>
</div>
</div>
</div>
<?php

0 comments on commit 5a22aa9

Please sign in to comment.