Fix settings page subforms (so all the fields show for the cache)
This commit is contained in:
parent
e4018c269f
commit
c4fb095eba
5
app/views/settings/_field.php
Normal file
5
app/views/settings/_field.php
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<article>
|
||||||
|
<label for="<?= $fieldName ?>"><?= $field['title'] ?></label><br />
|
||||||
|
<small><?= $field['description'] ?></small><br />
|
||||||
|
<?= $helper->field($fieldName, $field); ?>
|
||||||
|
</article>
|
@ -6,19 +6,19 @@
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<?php foreach ($fields as $name => $field): ?>
|
<?php foreach ($fields as $name => $field): ?>
|
||||||
<?php $fieldname = ($section === 'config' || $nestedPrefix !== 'config') ? "{$nestedPrefix}[{$name}]" : "{$nestedPrefix}[{$section}][{$name}]"; ?>
|
<?php
|
||||||
|
$fieldName = ($section === 'config' || $nestedPrefix !== 'config')
|
||||||
|
? "{$nestedPrefix}[{$name}]"
|
||||||
|
: "{$nestedPrefix}[{$section}][{$name}]";
|
||||||
|
?>
|
||||||
<?php if ($field['type'] === 'subfield'): ?>
|
<?php if ($field['type'] === 'subfield'): ?>
|
||||||
<section>
|
<section>
|
||||||
<h4><?= $field['title'] ?></h4>
|
<h4><?= $field['title'] ?></h4>
|
||||||
<?php include_once '_form.php'; ?>
|
<?php include '_subfield.php'; ?>
|
||||||
</section>
|
</section>
|
||||||
<?php elseif ( ! empty($field['display'])): ?>
|
<?php elseif ( ! empty($field['display'])): ?>
|
||||||
<article>
|
<?php include '_field.php' ?>
|
||||||
<label for="<?= $fieldname ?>"><?= $field['title'] ?></label><br />
|
|
||||||
<small><?= $field['description'] ?></small><br />
|
|
||||||
<?= $helper->field($fieldname, $field); ?>
|
|
||||||
</article>
|
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<?php $hiddenFields[] = $helper->field($fieldname, $field); ?>
|
<?php $hiddenFields[] = $helper->field($fieldName, $field); ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
|
20
app/views/settings/_subfield.php
Normal file
20
app/views/settings/_subfield.php
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
// Higher scoped variables:
|
||||||
|
// $field
|
||||||
|
// $fields
|
||||||
|
// $hiddenFields
|
||||||
|
// $nestedPrefix
|
||||||
|
?>
|
||||||
|
|
||||||
|
<?php foreach ($field['fields'] as $name => $field): ?>
|
||||||
|
<?php
|
||||||
|
$fieldName = ($section === 'config' || $nestedPrefix !== 'config')
|
||||||
|
? "{$nestedPrefix}[{$name}]"
|
||||||
|
: "{$nestedPrefix}[{$section}][{$name}]";
|
||||||
|
?>
|
||||||
|
<?php if ( ! empty($field['display'])): ?>
|
||||||
|
<?php include '_field.php' ?>
|
||||||
|
<?php else: ?>
|
||||||
|
<?php $hiddenFields[] = $helper->field($fieldName, $field); ?>
|
||||||
|
<?php endif ?>
|
||||||
|
<?php endforeach ?>
|
Loading…
Reference in New Issue
Block a user