Might be worth changing you widget class markup

This topic contains 3 replies, has 3 voices, and was last updated by  Stiofan O’Connor 10 years, 7 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #2707

    Kevin Heath
    Buyer
    Post count: 33

    It might be worth changing your widgets.php file to allow a more specific naming of widgets to :

    
    
    
    <div class="widget %2$s">
    

    This then will give each widget a specific name and makes it much easier for developers to use css to remove unnecessary widgets when doing responsive design.

    It’s nice to have things like sliders and image widgets for desktops and possibly tablets but for smartphones they add to download times and in many cases are just eye-candy that can be dropped.

    An example if you use the above coding in place of just widget in

    
    
    
    if(get_option('geodir_show_home_top_section')){
    		register_sidebars(1,array('id'=> 'geodir_home_top','name' => __('GD Home Top Section',GEODIRECTORY_TEXTDOMAIN),'before_widget' => '<div class="widget %2$s">','after_widget' => '</div>','before_title' => '<h3><span>','after_title' => '</span></h3>'));
    

    Then the widget for GD>search would be named as:

    
    
    
    class="widget geodir_advance_search_widget"
    

    instead of just class=”widget”

    It really comes into it’s own though when you start to use text widgets because each text widget then gets assigned its own id rather than just being named widget.

    Just a thought

    thanks
    Kevin

    #2708

    Kevin Heath
    Buyer
    Post count: 33

    whoops

    My mistake – wrong identifier

    you need to use %1$s and not %2$s otherwise it will not assign individual numbers to multiple text areas etc

    Kevin

    #2733

    Paolo
    Site Admin
    Post count: 31206

    Thanks for the suggestion, I’ve flag this for Vikas…

    #3345

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Done, will be in the next version.

    Thanks,

    Stiofan

Viewing 4 posts - 1 through 4 (of 4 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount