• Resolved deanselinger

    (@deanselinger)


    I am attempting to remove all errors from a site scan.
    2757 pages like the link provided are being flagged by the scan.
    I don’t want to have to remove all ical exports.
    I have tested for conflicts with my theme and other plugins.
    Using The Events Calendar version 5.7.0.

    I believe if I could display: none; the links from only dates with no events the scan wouldn’t crawl them.

    Any help appreciated

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter deanselinger

    (@deanselinger)

    Simple fix

    Override the day.php template in your own theme by creating a file at: [your-theme]/tribe/events/v2/day.php

    <?php
    /**
     * View: Day View
     * 
     * See more documentation about our views templating system.
     *
     * @link http://evnt.is/1aiy
     *
     * @version 5.2.1
     *
     * @var array    $events               The array containing the events.
     * @var string   $rest_url             The REST URL.
     * @var string   $rest_method          The HTTP method, either <code>POST</code> or <code>GET</code>, the View will use to make requests.
     * @var string   $rest_nonce           The REST nonce.
     * @var bool     $disable_event_search Boolean on whether to disable the event search.
     * @var string[] $container_classes    Classes used for the container of the view.
     * @var bool     $should_manage_url    Whether the view should manage the URL or not.
     * @var array    $container_data       An additional set of container <code>data</code> attributes.
     * @var string   $breakpoint_pointer   String we use as pointer to the current view we are setting up with breakpoints.
     */
    
    $header_classes = [ 'tribe-events-header' ];
    if ( empty( $disable_event_search ) ) {
    	$header_classes[] = 'tribe-events-header--has-event-search';
    }
    
    ?>
    <div
    	<?php tribe_classes( $container_classes ); ?>
    	data-js="tribe-events-view"
    	data-view-rest-nonce="<?php echo esc_attr( $rest_nonce ); ?>"
    	data-view-rest-url="<?php echo esc_url( $rest_url ); ?>"
    	data-view-rest-method="<?php echo esc_attr( $rest_method ); ?>"
    	data-view-manage-url="<?php echo esc_attr( $should_manage_url ); ?>"
    	<?php foreach ( $container_data as $key => $value ) : ?>
    		data-view-<?php echo esc_attr( $key ) ?>="<?php echo esc_attr( $value ) ?>"
    	<?php endforeach; ?>
    	<?php if ( ! empty( $breakpoint_pointer ) ) : ?>
    		data-view-breakpoint-pointer="<?php echo esc_attr( $breakpoint_pointer ); ?>"
    	<?php endif; ?>
    >
    	<div class="tribe-common-l-container tribe-events-l-container">
    		<?php $this->template( 'components/loader', [ 'text' => __( 'Loading...', 'the-events-calendar' ) ] ); ?>
    
    		<?php $this->template( 'components/json-ld-data' ); ?>
    
    		<?php $this->template( 'components/data' ); ?>
    
    		<?php $this->template( 'components/before' ); ?>
    
    		<header <?php tribe_classes( $header_classes ); ?>>
    			<?php $this->template( 'components/messages' ); ?>
    
    			<?php $this->template( 'components/breadcrumbs' ); ?>
    
    			<?php $this->template( 'components/events-bar' ); ?>
    
    			<?php $this->template( 'day/top-bar' ); ?>
    		</header>
    
    		<?php $this->template( 'components/filter-bar' ); ?>
    
    		<div class="tribe-events-calendar-day">
    
    			<?php foreach ( $events as $event ) : ?>
    				<?php $this->setup_postdata( $event ); ?>
    
    				<?php $this->template( 'day/type-separator', [ 'event' => $event ] ); ?>
    				<?php $this->template( 'day/time-separator', [ 'event' => $event ] ); ?>
    				<?php $this->template( 'day/event', [ 'event' => $event ] ); ?>
    				<?php $has_event = true; //added set has_event flag ?>
    			<?php endforeach; ?>
    
    		</div>
    
    		<?php $this->template( 'day/nav' ); ?>
    
    		<?php if($has_event) { $this->template( 'components/ical-link' ); }  //added the if statement ?>
    
    		<?php $this->template( 'components/after' ); ?>
    
    	</div>
    
    </div>
    
    <?php $this->template( 'components/breakpoints' ); ?>
    
    Thread Starter deanselinger

    (@deanselinger)

    To remove the ical export link from empty Calendar views

    Override the day.php template in your own theme by creating a file at: [your-theme]/tribe/events/v2/month.php

    <?php
    /**
     * View: Month View
     *
     * See more documentation about our views templating system.
     *
     * @link http://evnt.is/1aiy
     *
     * @version  5.0.2
     *
     * @var string   $rest_url             The REST URL.
     * @var string   $rest_method          The HTTP method, either <code>POST</code> or <code>GET</code>, the View will use to make requests.
     * @var string   $rest_nonce           The REST nonce.
     * @var int      $should_manage_url    int containing if it should manage the URL.
     * @var bool     $disable_event_search Boolean on whether to disable the event search.
     * @var string[] $container_classes    Classes used for the container of the view.
     * @var array    $container_data       An additional set of container <code>data</code> attributes.
     * @var string   $breakpoint_pointer   String we use as pointer to the current view we are setting up with breakpoints.
     */
    global $has_events;
    
    $header_classes = [ 'tribe-events-header' ];
    if ( empty( $disable_event_search ) ) {
    	$header_classes[] = 'tribe-events-header--has-event-search';
    }
    ?>
    <div
    	<?php tribe_classes( $container_classes ); ?>
    	data-js="tribe-events-view"
    	data-view-rest-nonce="<?php echo esc_attr( $rest_nonce ); ?>"
    	data-view-rest-url="<?php echo esc_url( $rest_url ); ?>"
    	data-view-rest-method="<?php echo esc_attr( $rest_method ); ?>"
    	data-view-manage-url="<?php echo esc_attr( $should_manage_url ); ?>"
    	<?php foreach ( $container_data as $key => $value ) : ?>
    		data-view-<?php echo esc_attr( $key ) ?>="<?php echo esc_attr( $value ) ?>"
    	<?php endforeach; ?>
    	<?php if ( ! empty( $breakpoint_pointer ) ) : ?>
    		data-view-breakpoint-pointer="<?php echo esc_attr( $breakpoint_pointer ); ?>"
    	<?php endif; ?>
    >
    	<div class="tribe-common-l-container tribe-events-l-container">
    		<?php $this->template( 'components/loader', [ 'text' => __( 'Loading...', 'the-events-calendar' ) ] ); ?>
    
    		<?php $this->template( 'components/json-ld-data' ); ?>
    
    		<?php $this->template( 'components/data' ); ?>
    
    		<?php $this->template( 'components/before' ); ?>
    
    		<header <?php tribe_classes( $header_classes ); ?>>
    			<?php $this->template( 'components/messages' ); ?>
    
    			<?php $this->template( 'components/breadcrumbs' ); ?>
    
    			<?php $this->template( 'components/events-bar' ); ?>
    
    			<?php $this->template( 'month/top-bar' ); ?>
    		</header>
    
    		<?php $this->template( 'components/filter-bar' ); ?>
    
    		<div
    			class="tribe-events-calendar-month"
    			role="grid"
    			aria-labelledby="tribe-events-calendar-header"
    			aria-readonly="true"
    			data-js="tribe-events-month-grid"
    		>
    
    			<?php $this->template( 'month/calendar-header' ); ?>
    
    			<?php $cal_output = $this->template( 'month/calendar-body' ); ?>
    
    		</div>
    
    		<?php $this->template( 'month/mobile-events' ); ?>
    
    		<?php
    			//check calendar-body output for event classes
    			if (str_contains($cal_output, 'tribe-events-calendar-month__multiday-event-wrapper') 
    				|| str_contains($cal_output, 'tribe-events-calendar-month__calendar-event') ) { 
    				$this->template( 'components/ical-link' ); 
    			} ?>
    
    		<?php $this->template( 'components/after' ); ?>
    
    	</div>
    
    </div>
    
    <?php $this->template( 'components/breakpoints' ); ?>
    
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Empty page returned by ?ical=1’ is closed to new replies.