Shows item thumbnail as thumb for the document in gallery mode of item single page. #27.

This commit is contained in:
mateuswetah 2020-04-09 16:12:48 -03:00
parent 272c8f974e
commit 140cc349ef
4 changed files with 109 additions and 5 deletions

View File

@ -611,6 +611,7 @@
text-align: center;
display: inline-block;
vertical-align: top;
cursor: pointer;
@media only screen and (max-width: 380px) {
margin: 10px 0;
}
@ -618,6 +619,7 @@
img {
width: 125px;
height: 125px;
display: inline-block;
&:focus {
outline: none;
}
@ -644,6 +646,9 @@
padding: 42px;
background-color: #dbdbdb;
}
.item-card--thumbnail {
margin: 0 0 4px 0 !important;
}
}
.single-item-collection--attachments-prev {
left: -50px;

View File

@ -357,6 +357,102 @@ function tainacan_customize_register( $wp_customize ) {
'label' => __( 'Display a header of the related collection.', 'tainacan-interface' ),
'description' => __( 'Toggle to show a banner with name, thumbnail and color of the related collection.', 'tainacan-interface' )
) );
/**
* Adds section to control collection items page. ---------------------------------------------------------
*/
$wp_customize->add_section( 'tainacan_items_page', array(
'title' => __( 'Tainacan items page', 'tainacan-interface' ),
'description' => __( 'Settings related to Tainacan items list pages.', 'tainacan-interface' ),
'priority' => 161,
'capability' => 'edit_theme_options'
) );
/**
* Adds option to hide filters panel on every items list.
*/
$wp_customize->add_setting( 'tainacan_items_page_hide_filters', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'default' => false,
'transport' => 'refresh'
) );
$wp_customize->add_control( 'tainacan_items_page_hide_filters', array(
'type' => 'checkbox',
'priority' => 0, // Within the section.
'section' => 'tainacan_items_page',
'label' => __( 'Hide the filters panel.', 'tainacan-interface' ),
'description' => __( 'Toggle to hide the filters panel completely.', 'tainacan-interface' )
) );
/**
* Adds option to hide the "hide filters" button on every items list.
*/
$wp_customize->add_setting( 'tainacan_items_page_hide_hide_filters_button', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'default' => false,
'transport' => 'refresh'
) );
$wp_customize->add_control( 'tainacan_items_page_hide_hide_filters_button', array(
'type' => 'checkbox',
'priority' => 1, // Within the section.
'section' => 'tainacan_items_page',
'label' => __( 'Hide the "Hide filters" button.', 'tainacan-interface' ),
'description' => __( 'Toggle to do not show the "Hide filters" button for users.', 'tainacan-interface' )
) );
/**
* Adds option to hide search control on every items list.
*/
$wp_customize->add_setting( 'tainacan_items_page_hide_search', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'default' => false,
'transport' => 'refresh'
) );
$wp_customize->add_control( 'tainacan_items_page_hide_search', array(
'type' => 'checkbox',
'priority' => 3, // Within the section.
'section' => 'tainacan_items_page',
'label' => __( 'Hide the Search block.', 'tainacan-interface' ),
'description' => __( 'Toggle to do not show the on the search control bar.', 'tainacan-interface' )
) );
/**
* Adds option to hide advanced search link on every items list.
*/
$wp_customize->add_setting( 'tainacan_items_page_hide_advanced_search', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'default' => false,
'transport' => 'refresh'
) );
$wp_customize->add_control( 'tainacan_items_page_hide_advanced_search', array(
'type' => 'checkbox',
'priority' => 3, // Within the section.
'section' => 'tainacan_items_page',
'label' => __( 'Hide the Advanced Search link.', 'tainacan-interface' ),
'description' => __( 'Toggle to do not show the on the advanced search link on the control bar.', 'tainacan-interface' )
) );
/**
* Adds option to hide the "sort by" button on every items list.
*/
$wp_customize->add_setting( 'tainacan_items_page_hide_sort_by_button', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'default' => false,
'transport' => 'refresh'
) );
$wp_customize->add_control( 'tainacan_items_page_hide_sort_by_button', array(
'type' => 'checkbox',
'priority' => 3, // Within the section.
'section' => 'tainacan_items_page',
'label' => __( 'Hide the "Sort by" button.', 'tainacan-interface' ),
'description' => __( 'Toggle to do not show the "Sort by" button on the control bar.', 'tainacan-interface' )
) );
}
add_action( 'customize_register', 'tainacan_customize_register', 11 );

File diff suppressed because one or more lines are too long

View File

@ -53,7 +53,7 @@ if (get_theme_mod('tainacan_single_item_collection_header', false)) {
<img src="<?php echo get_the_post_thumbnail_url( tainacan_get_collection_id() ); ?>" class="t-collection--info-img rounded-circle img-fluid border border-white position-absolute text-left" alt="<?php echo esc_attr($alt); ?>">
<?php else : ?>
<div class="image-placeholder rounded-circle border border-white position-absolute">
<h4 class="text-center">
<h4 class="text-center">search=ful
<?php
echo esc_html( tainacan_get_initials( tainacan_get_the_collection_name() ) );
?>
@ -230,19 +230,21 @@ if (get_theme_mod('tainacan_single_item_collection_header', false)) {
<?php if ( tainacan_has_document() ) : ?>
<div class="single-item-collection--attachments-file">
<?php
tainacan_the_document();
the_post_thumbnail('tainacan-medium-full', array('class' => 'item-card--thumbnail mt-2'));
echo '<br>';
echo __( 'Document', 'tainacan-interface' );
?>
</div>
<?php endif; ?>
<?php foreach ( $attachments as $attachment ) { ?>
<div class="single-item-collection--attachments-file">
<a class="<?php if (!wp_get_attachment_image( $attachment->ID, 'tainacan-interface-item-attachments')) echo'attachment-without-image'; ?>">
<div class="<?php if (!wp_get_attachment_image( $attachment->ID, 'tainacan-interface-item-attachments')) echo'attachment-without-image'; ?>">
<?php
echo wp_get_attachment_image( $attachment->ID, 'tainacan-interface-item-attachments', true );
echo '<br>';
echo get_the_title( $attachment->ID );
?>
</a>
</div>
</div>
<?php } ?>
</div>
@ -265,6 +267,7 @@ if (get_theme_mod('tainacan_single_item_collection_header', false)) {
data-gallery="example-gallery">
<?php
echo wp_get_attachment_image( $attachment->ID, 'tainacan-interface-item-attachments', true );
echo '<br>';
echo get_the_title( $attachment->ID );
?>
</a>