Skip to content

Commit

Permalink
changes Draft to [Draft] for title
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Conroy committed Nov 9, 2023
1 parent e76e822 commit f527c95
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/schema/localgov_base.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ localgov_base.settings:
label: 'Remove pink background from unpublished content.'
localgov_base_add_draft_note_to_unpublished_content:
type: boolean
label: 'Add "Draft" to title of unpublished content.'
label: 'Add "[Draft]" to title of unpublished content.'
6 changes: 3 additions & 3 deletions localgov_base.theme
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function localgov_base_form_system_theme_settings_alter(&$form, FormStateInterfa
'#type' => 'checkbox',
'#title' => t('Remove pink background from unpublished content.'),
'#default_value' => theme_get_setting('localgov_base_remove_unpublished_background_colour'),
'#description' => t("If you remove the pink background, you should probably also check the box below to add 'Draft' to the title of unpublished content."),
'#description' => t("If you remove the pink background, you should probably also check the box below to add '[Draft]' to the title of unpublished content."),
];

$form['localgov_base_add_draft_note_to_unpublished_content'] = [
Expand Down Expand Up @@ -95,7 +95,7 @@ function localgov_base_preprocess_node(&$variables) {
$node_status = $variables['node']->isPublished();
if ($node_status === FALSE) {
if (theme_get_setting('localgov_base_add_draft_note_to_unpublished_content') == TRUE) {
$variables['label'] = t('Draft') . " " . $variables['node']->label();
$variables['label'] = t('[Draft]') . " " . $variables['node']->label();
}
}
}
Expand All @@ -113,7 +113,7 @@ function localgov_base_preprocess_block(&$variables) {
if (theme_get_setting('localgov_base_add_draft_note_to_unpublished_content') == TRUE) {
if ($variables['plugin_id'] === 'localgov_page_header_block') {
$current_title = $variables['content'][0]['#title'];
$variables['content'][0]['#title'] = t('Draft') . " " . $current_title;
$variables['content'][0]['#title'] = t('[Draft]') . " " . $current_title;
}
}
}
Expand Down

0 comments on commit f527c95

Please sign in to comment.