Skip to content

Commit

Permalink
Don't set termTemplate and template if they are the defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmitchell committed Jan 30, 2024
1 parent 0da35cc commit a3d2a17
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Http/Controllers/CP/Taxonomies/TaxonomiesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ public function edit($taxonomy)
'collections' => $taxonomy->collections()->map->handle()->all(),
'sites' => $taxonomy->sites()->all(),
'preview_targets' => $taxonomy->basePreviewTargets(),
'term_template' => $taxonomy->termTemplate(),
'template' => $taxonomy->template(),
'term_template' => $taxonomy->termTemplate,
'template' => $taxonomy->template,
'layout' => $taxonomy->layout(),
];

Expand Down
14 changes: 14 additions & 0 deletions src/Taxonomies/Taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,13 @@ public function termTemplate($termTemplate = null)

return $termTemplate;
})
->setter(function ($termTemplate) {
if (! $termTemplate) {
return;
}

return $termTemplate;
})
->args(func_get_args());
}

Expand All @@ -403,6 +410,13 @@ public function template($template = null)

return $template;
})
->setter(function ($template) {
if (! $template) {
return;
}

return $template;
})
->args(func_get_args());
}

Expand Down

0 comments on commit a3d2a17

Please sign in to comment.