Making WordPress.org


Ignore:
Timestamp:
04/20/2017 04:12:08 PM (8 years ago)
Author:
Otto42
Message:

Plugin Directory: The return of tabs.

Change single-plugin view to have tabbed design. Eliminates read-more on all sections except developers and changelog, adds tabs back to interface using CSS to switch between them. Tabs control both main display as well as widgets.

Known issues: Changelog read-more not working (js issue), developers section is currently split using CSS, future change will split this section into two separate sections.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-single.php

    r5254 r5399  
    118118    </header><!-- .entry-header -->
    119119
     120<?php if ( ! get_query_var( 'plugin_advanced' ) ) { ?>
     121    <span id="description"></span>
     122    <span id="reviews"></span>
     123    <span id="installation"></span>
     124    <span id="developers"></span>
     125    <ul class="tabs clear">
     126        <li id="tablink-description"><a href='#description'><?php _e( 'Details', 'wporg-plugins' ); ?></a></li>
     127        <li id="tablink-reviews"><a href='#reviews'><?php _e( 'Reviews', 'wporg-plugins' ); ?></a></li>
     128<?php if ( isset( $content[ 'installation' ] ) ) { ?>
     129        <li id="tablink-installation"><a href='#installation'><?php _e( 'Installation', 'wporg-plugins' ); ?></a></li>
     130<?php } ?>
     131        <li id="tablink-support"><a href='https://wordpress.org/support/plugin/<?php echo $post->post_name; ?>'><?php _e( 'Support', 'wporg-plugins' ); ?></a></li>
     132        <li id="tablink-developers"><a href='#developers'><?php _e( 'Development', 'wporg-plugins' ); ?></a></li>
     133    </ul>
     134<?php } ?>
    120135    <div class="entry-content">
    121136        <?php
     
    125140            $plugin_sections = Template::get_plugin_sections();
    126141
    127             foreach ( array( 'description', 'screenshots', 'faq', 'reviews', 'changelog', 'developers' ) as $section_slug ) :
     142            foreach ( array( 'description', 'screenshots', 'installation', 'faq', 'reviews', 'developers', 'changelog' ) as $section_slug ) :
    128143                if ( ! isset( $content[ $section_slug ] ) ) {
    129144                    continue;
     
    138153                $section = array_pop( $section );
    139154
    140                 $section_no_read_mores = array( 'screenshots', 'reviews' );
     155                $section_no_read_mores = array( 'description', 'screenshots', 'installation', 'faq', 'reviews' );
    141156                // If the FAQ section is the newer `<dl>` form, no need to do read-more for it.
    142157                if ( false !== stripos( $section_content, '<dl>' ) ) {
Note: See TracChangeset for help on using the changeset viewer.