Fix settings page subforms (so all the fields show for the cache)
This commit is contained in:
parent
e724f885c8
commit
3ecccb6ad8
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 $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'): ?>
|
||||
<section>
|
||||
<h4><?= $field['title'] ?></h4>
|
||||
<?php include_once '_form.php'; ?>
|
||||
<?php include '_subfield.php'; ?>
|
||||
</section>
|
||||
<?php elseif ( ! empty($field['display'])): ?>
|
||||
<article>
|
||||
<label for="<?= $fieldname ?>"><?= $field['title'] ?></label><br />
|
||||
<small><?= $field['description'] ?></small><br />
|
||||
<?= $helper->field($fieldname, $field); ?>
|
||||
</article>
|
||||
<?php include '_field.php' ?>
|
||||
<?php else: ?>
|
||||
<?php $hiddenFields[] = $helper->field($fieldname, $field); ?>
|
||||
<?php $hiddenFields[] = $helper->field($fieldName, $field); ?>
|
||||
<?php endif ?>
|
||||
<?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