Adds section label options.

This commit is contained in:
mateuswetah 2020-09-30 11:05:55 -03:00
parent 02f6a36954
commit f56691fd7b
6 changed files with 42 additions and 20 deletions

View File

@ -12,7 +12,7 @@ if (! isset($enabled)) {
$options = [
$prefix . 'display_section_labels' => [
'label' => __( 'Display section labels', 'blocksy' ),
'label' => __( 'Display section labels', 'blocksy-tainacan' ),
'type' => 'ct-panel',
'switch' => true,
'value' => $enabled,
@ -20,16 +20,36 @@ $options = [
'prefix' => $prefix,
]),
'inner-options' => [
// $prefix . 'test_title_metadata' => [
// 'label' => __( 'Test title in the metadata list', 'blocksy-tainacan' ),
// 'type' => 'ct-switch',
// 'value' => 'yes',
// 'setting' => [ 'transport' => 'postMessage' ],
// 'desc' => __( 'Toggle to hide or not the core title from the metadada list, as it already appears on the page title.', 'blocksy' ),
// 'sync' => blocksy_sync_single_post_container([
// 'prefix' => $prefix
// ])
// ]
$prefix . 'section_document_label' => [
'label' => __( 'Label for the "Document" section', 'blocksy-tainacan' ),
'desc' => __( 'Leave it blank for not displaying any label.', 'blocksy-tainacan' ),
'type' => 'text',
'design' => 'block',
'value' => __( 'Document', 'blocksy-tainacan' ),
'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix
])
],
$prefix . 'section_attachments_label' => [
'label' => __( 'Label for the "Attachments" section', 'blocksy-tainacan' ),
'desc' => __( 'Leave it blank for not displaying any label.', 'blocksy-tainacan' ),
'type' => 'text',
'design' => 'block',
'value' => __( 'Attachments', 'blocksy-tainacan' ),
'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix
])
],
$prefix . 'section_metadata_label' => [
'label' => __( 'Label for the "Metadata" section', 'blocksy-tainacan' ),
'desc' => __( 'Leave it blank for not displaying any label.', 'blocksy-tainacan' ),
'type' => 'text',
'design' => 'block',
'value' => __( 'Metadata', 'blocksy-tainacan' ),
'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix
])
]
],
],
];

View File

@ -16,7 +16,7 @@ $options = [
'type' => 'ct-switch',
'value' => $enabled,
'setting' => [ 'transport' => 'postMessage' ],
'desc' => __( 'Toggle to show or not the item thumbnail on the metadada list.', 'blocksy' ),
'desc' => __( 'Toggle to show or not the item thumbnail on the metadada list.', 'blocksy-tainacan' ),
'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix
])

View File

@ -289,6 +289,5 @@
right: 10px;
}
}
}
}

View File

@ -15,14 +15,14 @@
)
);
}
$prefix = blocksy_manager()->screen->get_prefix();
?>
<?php if ( !empty( $attachments ) || ( get_theme_mod( 'tainacan_single_item_gallery_mode', false) && tainacan_has_document() )) : ?>
<div>
<?php if ( !get_theme_mod( 'tainacan_single_item_gallery_mode', false ) && get_theme_mod('tainacan_single_item_attachments_section_label', __( 'Attachments', 'blocksy-tainacan' )) != '') : ?>
<?php if ( get_theme_mod($prefix . '_display_section_labels', 'yes') == 'yes' && get_theme_mod($prefix . '_section_attachments_label', __( 'Attachments', 'blocksy-tainacan' )) != '' ) : ?>
<h2 class="title-content-items" id="single-item-attachments-label">
<?php echo esc_html( get_theme_mod('tainacan_single_item_attachments_section_label', __( 'Attachments', 'blocksy-tainacan' )) ); ?>
<?php echo esc_html( get_theme_mod($prefix . '_section_attachments_label', __( 'Attachments', 'blocksy-tainacan' ) ) ); ?>
</h2>
<?php endif; ?>
<?php if ( get_theme_mod( 'tainacan_single_item_gallery_mode', false ) && get_theme_mod('tainacan_single_item_documents_section_label', __( 'Documents', 'blocksy-tainacan' )) != '') : ?>

View File

@ -1,8 +1,11 @@
<?php
$prefix = blocksy_manager()->screen->get_prefix();
?>
<?php if ( tainacan_has_document() && !get_theme_mod( 'tainacan_single_item_gallery_mode', false )) : ?>
<div>
<?php if ( get_theme_mod('tainacan_single_item_document_section_label', __( 'Document', 'blocksy-tainacan' )) != '') : ?>
<?php if ( get_theme_mod($prefix . '_display_section_labels', 'yes') == 'yes' && get_theme_mod($prefix . '_section_document_label', __( 'Document', 'blocksy-tainacan' )) != '' ) : ?>
<h2 class="title-content-items" id="single-item-document-label">
<?php echo esc_html( get_theme_mod('tainacan_single_item_document_section_label', __( 'Document', 'blocksy-tainacan' )) ); ?>
<?php echo esc_html( get_theme_mod($prefix . '_section_document_label', __( 'Document', 'blocksy-tainacan' ) ) ); ?>
</h2>
<?php endif; ?>
<section class="tainacan-content single-item-collection margin-two-column">

View File

@ -2,9 +2,9 @@
$prefix = blocksy_manager()->screen->get_prefix();
?>
<div>
<?php if ( get_theme_mod('tainacan_single_item_metadata_section_label', '') != '') : ?>
<?php if ( get_theme_mod($prefix . '_display_section_labels', 'yes') == 'yes' && get_theme_mod($prefix . '_section_metadata_label', __( 'Metadata', 'blocksy-tainacan' )) != '' ) : ?>
<h2 class="title-content-items" id="single-item-metadata-label">
<?php echo esc_html( get_theme_mod('tainacan_single_item_metadata_section_label', '') ); ?>
<?php echo esc_html( get_theme_mod($prefix . '_section_metadata_label', __( 'Metadata', 'blocksy-tainacan' ) ) ); ?>
</h2>
<?php endif; ?>
<section class="tainacan-content single-item-collection margin-two-column">