Skip to content

Commit

Permalink
[com_fields] Moving dd tag from field JLayout to fields JLayout (#15013)
Browse files Browse the repository at this point in the history
* Moving <dd> from field JLayout to fields JLayout

* Remove no longer used $class
  • Loading branch information
Thomas Hunziker authored and rdeutz committed Apr 18, 2017
1 parent b0d83f6 commit 72bbc90
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 25 deletions.
11 changes: 3 additions & 8 deletions components/com_fields/layouts/field/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,14 @@
$field = $displayData['field'];
$label = JText::_($field->label);
$value = $field->value;
$class = $field->params->get('render_class');
$showlabel = $field->params->get('showlabel');

if ($value == '')
{
return;
}

?>

<dd class="field-entry <?php echo $class; ?>">
<?php if ($showlabel == 1) : ?>
<?php if ($showlabel == 1) : ?>
<span class="field-label"><?php echo htmlentities($label, ENT_QUOTES | ENT_IGNORE, 'UTF-8'); ?>: </span>
<?php endif; ?>
<span class="field-value"><?php echo $value; ?></span>
</dd>
<?php endif; ?>
<span class="field-value"><?php echo $value; ?></span>
29 changes: 12 additions & 17 deletions components/com_fields/layouts/fields/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,16 @@
{
return;
}

// Print the container tag
echo '<dl class="fields-container">';

// Loop through the fields and print them
foreach ($fields as $field)
{
// If the value is empty do nothing
if (!isset($field->value) || $field->value == '')
{
?>
<dl class="fields-container">
<?php foreach ($fields as $field) : ?>
<?php // If the value is empty do nothing
if (!isset($field->value) or $field->value == '') :
continue;
}

echo FieldsHelper::render($context, 'field.render', array('field' => $field));
}

// Close the container
echo '</dl>';
endif; ?>
<?php $class = $field->params->get('render_class'); ?>
<dd class="field-entry <?php echo $class; ?>">
<?php echo FieldsHelper::render($context, 'field.render', array('field' => $field)); ?>
</dd>
<?php endforeach; ?>
</dl>

0 comments on commit 72bbc90

Please sign in to comment.