Uses media component in document even when not in gallery view mode.

This commit is contained in:
mateuswetah 2021-07-03 09:22:45 -03:00
parent 3c73968949
commit 460e429a5a
2 changed files with 52 additions and 2 deletions

View File

@ -2314,6 +2314,7 @@ function tainacan_get_color_scheme_css( $colors ) {
}
.tainacan-title-page ul li,
.tainacan-title-page ul li a,
.tainacan-title-page ul li h1,
#menubelowHeader .menu-item a::after,
.menu-shadow button[data-toggle='dropdown']::after{
color: {$colors['tainacan_link_color']} !important;

View File

@ -14,6 +14,8 @@ if (version_compare(TAINACAN_VERSION, '0.18RC') >= 0) {
$class_slide_metadata .= ' hide-description';
if ($hide_file_caption)
$class_slide_metadata .= ' hide-caption';
global $post;
}
if ( tainacan_has_document() && !get_theme_mod( 'tainacan_single_item_gallery_mode', false )) : ?>
@ -25,7 +27,8 @@ if ( tainacan_has_document() && !get_theme_mod( 'tainacan_single_item_gallery_mo
<?php endif; ?>
<section class="tainacan-content single-item-collection margin-two-column">
<div class="single-item-collection--document">
<?php
<?php if ( !function_exists('tainacan_get_the_media_component') ) {
tainacan_the_document();
if ( !get_theme_mod( 'tainacan_single_item_hide_download_document', false ) && function_exists('tainacan_the_item_document_download_link') && tainacan_the_item_document_download_link() != '' )
@ -53,7 +56,53 @@ if ( tainacan_has_document() && !get_theme_mod( 'tainacan_single_item_gallery_mo
</div>
<?php
}
?>
} else {
$media_items_main = array();
$class_slide_metadata = '';
if ($hide_file_name)
$class_slide_metadata .= ' hide-name';
if ($hide_file_description)
$class_slide_metadata .= ' hide-description';
if ($hide_file_caption)
$class_slide_metadata .= ' hide-caption';
if ( tainacan_has_document() ) {
$is_document_type_attachment = tainacan_get_the_document_type() === 'attachment';
$media_items_main[] =
tainacan_get_the_media_component_slide(array(
'after_slide_metadata' => (( !get_theme_mod( 'tainacan_single_item_hide_download_document', false ) && tainacan_the_item_document_download_link() != '' ) ?
('<span class="tainacan-item-file-download">' . tainacan_the_item_document_download_link() . '</span>')
: ''),
'media_content' => tainacan_get_the_document(),
'media_content_full' => $is_document_type_attachment ? tainacan_get_the_document(0, 'full') : ('<div class="attachment-without-image">' . tainacan_get_the_document(0, 'full') . '</div>'),
'media_title' => $is_document_type_attachment ? get_the_title(tainacan_get_the_document_raw()) : '',
'media_description' => $is_document_type_attachment ? get_the_content(tainacan_get_the_document_raw()) : '',
'media_caption' => $is_document_type_attachment ? wp_get_attachment_caption(tainacan_get_the_document_raw()) : '',
'media_type' => tainacan_get_the_document_type(),
'class_slide_metadata' => $class_slide_metadata
));
}
tainacan_the_media_component(
'tainacan-item-document_id-' . $post->ID,
null,
$media_items_main,
array(
'class_main_div' => '',
'class_thumbs_div' => '',
'swiper_thumbs_options' => '',
'swiper_main_options' => array(
'navigation' => array(
'nextEl' => '.swiper-navigation-next_' . 'tainacan-item-document_id-' . $post->ID . '-main',
'prevEl' => '.swiper-navigation-prev_' . 'tainacan-item-document_id-' . $post->ID . '-main',
)
)
)
);
}?>
</div>
</section>
</div>