diff --git a/src/wp-content/themes/tuleva/helpers/acf/fund-pension.php b/src/wp-content/themes/tuleva/helpers/acf/fund-pension.php index b3b47a31..35e1ebfc 100644 --- a/src/wp-content/themes/tuleva/helpers/acf/fund-pension.php +++ b/src/wp-content/themes/tuleva/helpers/acf/fund-pension.php @@ -52,4 +52,52 @@ 'show_in_rest' => 1, )); +acf_add_local_field_group(array ( + 'key' => 'group_fund_pension_sustainability', + 'title' => 'Sustainability', + 'fields' => array ( + array ( + 'key' => 'field_fund_pension_co2_intensity', + 'label' => 'CO2 Intensity', + 'name' => 'fund_co2_intensity', + // Text, not number: the figure is rendered verbatim and trailing zeros are + // significant ("133.80" must not collapse to "133.8"). Matches TKF100's field. + 'type' => 'text', + 'instructions' => 'CO2 intensity value (number only, e.g. "83.68"). When set, this replaces the hardcoded figure in the template.', + 'required' => 0, + ), + ), + 'location' => array ( + array ( + array ( + 'param' => 'page_template', + 'operator' => '==', + 'value' => 'page_fund-stocks.php', + ), + ), + array ( + array ( + 'param' => 'page_template', + 'operator' => '==', + 'value' => 'page_fund-bonds.php', + ), + ), + array ( + array ( + 'param' => 'page_template', + 'operator' => '==', + 'value' => 'page_fund-third.php', + ), + ), + ), + 'menu_order' => 11, + 'position' => 'normal', + 'style' => 'default', + 'label_placement' => 'top', + 'instruction_placement' => 'label', + 'active' => 1, + // Same REST requirement as the investment report group above. + 'show_in_rest' => 1, +)); + endif; diff --git a/src/wp-content/themes/tuleva/helpers/acf/fund-savings.php b/src/wp-content/themes/tuleva/helpers/acf/fund-savings.php index fe45c582..b9ad0b09 100644 --- a/src/wp-content/themes/tuleva/helpers/acf/fund-savings.php +++ b/src/wp-content/themes/tuleva/helpers/acf/fund-savings.php @@ -176,6 +176,10 @@ 'label_placement' => 'top', 'instruction_placement' => 'label', 'active' => 1, + // Lets fund_co2_intensity be set over the REST API, the same way the pension funds' + // field is. TKF100 has no CO2 figure yet; the template hides the whole block while the + // field is empty, so this stays inert until someone supplies a value. + 'show_in_rest' => 1, )); // Documents fields diff --git a/src/wp-content/themes/tuleva/templates/components/fund-bonds-details.php b/src/wp-content/themes/tuleva/templates/components/fund-bonds-details.php index 0d14738f..ec05ee2d 100644 --- a/src/wp-content/themes/tuleva/templates/components/fund-bonds-details.php +++ b/src/wp-content/themes/tuleva/templates/components/fund-bonds-details.php @@ -95,7 +95,15 @@
- +
diff --git a/src/wp-content/themes/tuleva/templates/components/fund-stocks-details.php b/src/wp-content/themes/tuleva/templates/components/fund-stocks-details.php index 5a133b4b..ee1a0fcb 100644 --- a/src/wp-content/themes/tuleva/templates/components/fund-stocks-details.php +++ b/src/wp-content/themes/tuleva/templates/components/fund-stocks-details.php @@ -94,7 +94,15 @@- +
diff --git a/src/wp-content/themes/tuleva/templates/components/fund-third-details.php b/src/wp-content/themes/tuleva/templates/components/fund-third-details.php index 4f7d2f39..11d65174 100644 --- a/src/wp-content/themes/tuleva/templates/components/fund-third-details.php +++ b/src/wp-content/themes/tuleva/templates/components/fund-third-details.php @@ -94,7 +94,15 @@- +