2020-11-25 16:20:54 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* The template for displaying all single items
|
|
|
|
*
|
|
|
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
|
|
|
|
*
|
|
|
|
* @package BlocksyTainacan
|
|
|
|
*/
|
|
|
|
|
2020-12-29 04:33:20 +00:00
|
|
|
$prefix = blocksy_manager()->screen->get_prefix();
|
2020-11-25 16:20:54 +00:00
|
|
|
|
2020-12-29 04:33:20 +00:00
|
|
|
do_action( 'blocksy-tainacan-single-item-top' );
|
2020-11-25 16:20:54 +00:00
|
|
|
|
2020-12-29 04:33:20 +00:00
|
|
|
do_action( 'blocksy-tainacan-single-item-after-title' );
|
2020-11-25 16:20:54 +00:00
|
|
|
|
2020-12-30 03:31:53 +00:00
|
|
|
$page_structure_type = get_theme_mod( $prefix . '_page_structure_type', 'type-dam');
|
|
|
|
$template_columns_style = '';
|
|
|
|
|
|
|
|
if ($page_structure_type == 'type-gm' || $page_structure_type == 'type-mg') {
|
|
|
|
$column_documents_attachments_width = 60;
|
|
|
|
$column_metadata_width = 40;
|
|
|
|
|
|
|
|
$column_documents_attachments_width = intval(substr(get_theme_mod( $prefix . '_document_attachments_columns', '60%'), 0, -1));
|
|
|
|
$column_metadata_width = 100 - $column_documents_attachments_width;
|
|
|
|
|
|
|
|
if ($page_structure_type == 'type-gm') {
|
|
|
|
$template_columns_style = 'grid-template-columns: ' . $column_documents_attachments_width . '% calc(' . $column_metadata_width . '% - 32px)';
|
|
|
|
} else {
|
|
|
|
$template_columns_style = 'grid-template-columns: ' . $column_metadata_width . '% calc(' . $column_documents_attachments_width . '% - 32px)';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '<div class="tainacan-item-single tainacan-item-single--layout-'. $page_structure_type . '" style="' . $template_columns_style .'">';
|
2020-11-25 16:20:54 +00:00
|
|
|
|
2020-12-29 04:33:20 +00:00
|
|
|
get_template_part( 'template-parts/tainacan-item-single-document' );
|
|
|
|
do_action( 'blocksy-tainacan-single-item-after-document' );
|
2020-11-25 16:20:54 +00:00
|
|
|
|
2020-12-29 04:33:20 +00:00
|
|
|
get_template_part( 'template-parts/tainacan-item-single-attachments' );
|
|
|
|
do_action( 'blocksy-tainacan-single-item-after-attachments' );
|
|
|
|
|
|
|
|
get_template_part( 'template-parts/tainacan-item-single-metadata' );
|
|
|
|
do_action( 'blocksy-tainacan-single-item-after-metadata' );
|
2020-11-25 16:20:54 +00:00
|
|
|
|
|
|
|
echo '</div>';
|
|
|
|
|
|
|
|
do_action( 'blocksy-tainacan-single-item-bottom' ); ?>
|