• Welcome to Tux Reports: Where Penguins Fly. We hope you find the topics varied, interesting, and worthy of your time. Please become a member and join in the discussions.

wrap elements in widgets

Adam H

Young Flying Bird
Just a suggestion but to help style xenword it would be great to naturally contain certain elements such as in xenword-xf-thread-all-forums-widget.php

The avatar and discussionlist item I personally think would be better served with either a container or in list format ( entirely up to you ) instead of two entirely separate elements. You will see below ive added a simple div class to wrap the discussion list and avatar holder allowing better control of styling.

Code:
// Use this function to display the avatar where ever you want.
                    echo ("<div class='threadListcontain'><div class='threadListAvatar'>" . get_avatar( $thread['user_id'], 35 ) . " </div>");

                    echo(
                        "<div class='threadListItem'><a href='"
                        . XenForo_Link::buildPublicLink( 'canonical:threads', $thread )
                        . "'>"
                        . XenForo_Helper_String::wholeWordTrim( $thread['title'], 40 )
                        . "</a>"
                    );

                    echo '<br />posted ' . date_i18n( get_option('date_format'), $thread['post_date'] );

                    $node = XenForo_Model::create( 'XenForo_Model_Node')->getNodeById($thread['node_id'] );

                    echo ' in ' . $node['title'];

                    echo '</div></div>';

I feel there is quite alot though out the whole plugin that could be adjusted to make it naturally friendlier to style with CSS alone rather than editing and adding classes outside of the core plugin default files.
 

Gracie

Dogs Times Writer
I've passed this on to @LPH. He's being stubborn about authentication. He keeps thinking "just a little bit closer." He's been writing that for over a week.

In my view, the CSS needs work on the whole plugin. I'd prefer a way in the XenWord settings panel to have a place to save CSS changes. It's possible. Many Redux Framework themes allow CSS fields.
 

LPH

Flight Director
Flight Instructor
I woke up this morning and decided to write the plugin from the ground up. The video in the link shows the authentication system working with caching plugins. The refresh after login is the last main sticking point.

Video of new authentication system

@Gracie and I agree that CSS should be a dynamic file available in the XenWord Settings. Themes are able to have this feature using Redux Framework, so it's possible. I just don't know how (yet).
 

Adam H

Young Flying Bird
Not personally a fan of plugins/themes which have an area for "additional" CSS which is then stored in the database myself, too many instances of customisations being lost and clients tinkering when they don't really know what they are doing.

Much prefer to override CSS in a custom CSS file or on the child theme CSS. Providing elements have a good class/id structure and containers/wrappers most things can be styled nicely, like above all it needed was a container but it could also be structured differently to use <li> instead of divs or what alot of themes are doing at the moment with widgets is <article> surrounding widget containers.

I meant to look the other day but is the xenword stylesheet for wordpress enqueue'd ?
 

Gracie

Dogs Times Writer
Opened class-xenword-stylesheets.php

PHP:
class XenWord_Stylesheets {

   public function __construct() {
      $this->load();
   }

   public function load() {
      add_action( 'wp_enqueue_scripts', array( $this, 'xenword_public_stylesheet' ) );
      add_action( 'admin_enqueue_scripts', array( $this, 'xenword_admin_stylesheet' ) );
   }

   /**
    * xenword_public_stylesheet
    */
   function xenword_public_stylesheet() {
      $plugin_url = plugin_dir_url( __FILE__ );
      wp_register_style( 'xenword-style', $plugin_url . '../public/css/xenword-public.css' );
      wp_enqueue_style( 'xenword-style' );
   }

   /**
    * xenword_admin_stylesheet
    */
   function xenword_admin_stylesheet() {
      $plugin_url = plugin_dir_url( __FILE__ );
      wp_register_style( 'xenword-admin-style', $plugin_url . '../admin/css/xenword-admin.css' );
      wp_enqueue_style( 'xenword-admin-style' );
   }
}

new XenWord_Stylesheets();
 

LPH

Flight Director
Flight Instructor
CSS needs some serious work in this plugin. It was slated as a priority after the comment system and authentication system were redone. With 3.0.6.01 now out the door, it's time to focus on it and any bug reports left to squash before going to a release candidate.
 
Top