Exclude selected tabs from detail page (if empty)

This topic contains 16 replies, has 9 voices, and was last updated by  nickd 8 years, 4 months ago.

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

Open Support Ticket

Tagged: , , ,

  • Author
    Posts
  • #6975

    justjim
    Free User
    Post count: 126

    There is a setting to exclude tabs, is it possible to exclude tabs only if they are empty? This would be very helpful. Thanks

    #6987

    migs
    Free User
    Post count: 42

    I agree, this would be very useful.

    #7026

    Paolo
    Site Admin
    Post count: 31206

    At the moment it isn’t. Not sure how easy it would be. If many other members +1 the request we will definitely consider it.

    Thx

    #7045

    justjim
    Free User
    Post count: 126

    How do I rally the troops?

    #7046

    directory
    Expired Member
    Post count: 1502

    +1 for an option to exclude tabs IF they are empty. And an option to rearrange the tab orders too will be nice.

    #7047

    justjim
    Free User
    Post count: 126

    just adding some tags so others can find this.

    #7048

    justjim
    Free User
    Post count: 126
    This reply has been marked as private.
    #7049

    identity
    Lifetime Member
    Post count: 445

    +1 to both hide if empty (especially if that could also be a toggled option) and rearrange.

    I’d also like to be able to not have the content be tabbed at all and hoping that will be easily doable once shortcodes are released.

    #7175

    justjim
    Free User
    Post count: 126

    Paulo, it looks like we have 4 +1’s are you looking for a lot more to consider the benefit of this feature?
    Thanks

    #7286

    Paolo
    Site Admin
    Post count: 31206

    Yes, 4 +1 don’t make it enough to add a new feature. It is less than 1% of users.

    We will consider it anyway, but it’s not on top of our priorities.

    Thx

    #7305

    Paolo
    Site Admin
    Post count: 31206

    Just FYI, to edit/rearrange tabs you need to create a new function and use the hook: geodir_detail_page_tab_list_extend

    Soon we will add all examples in the developer documentation. We are working on it, this week we are focusing on user documentation.

    I don’t think you’ll ever see us adding a UI to rearrange tabs or similar tasks. The plugin must remain lightweight and efficient and a UI would need more code that the funtion itself.

    Adding this simple snippet in your child theme functions.php for example, will show the Map Tab as the second tab:

    EDITED 14/11/2014- STIOFAN

    
    
    
    add_filter('geodir_detail_page_tab_list_extend', 'geodir_detail_page_tab_list_extend') ;
    
    function geodir_detail_page_tab_list_extend($tab_array)
    {
     // here u can modify this array, u can create a completely new one too.
         if(isset($tab_array['post_profile'])){
             $new_tab_array['post_profile'] = $tab_array['post_profile']; // set in new array
    		 unset($tab_array['post_profile']);//unset in old one
    	 }
    
         if(isset($tab_array['post_map'])){
             $new_tab_array['post_map'] = $tab_array['post_map'];// set in new array
    		 unset($tab_array['post_map']);//unset in old one
    	 }
    
        if(isset($tab_array['special_offers'])){
             $new_tab_array['special_offers'] = $tab_array['special_offers'];// set in new array
    		 unset($tab_array['special_offers']);//unset in old one
    	}
    
         if(isset($tab_array['post_info'])){
             $new_tab_array['post_info'] = $tab_array['post_info'];// set in new array
    		 unset($tab_array['post_info']);//unset in old one
    	 }
    
        if(isset($tab_array['post_images'])){
             $new_tab_array['post_images'] = $tab_array['post_images'];// set in new array
    		 unset($tab_array['post_images']);//unset in old one
    	}
    
        if(isset($tab_array['post_video'])){
             $new_tab_array['post_video'] = $tab_array['post_video'];// set in new array
    		 unset($tab_array['post_video']);//unset in old one
    	}
    
         if(isset($tab_array['special_offers'])){
             $new_tab_array['special_offers'] = $tab_array['special_offers'];// set in new array
    		 unset($tab_array['special_offers']);//unset in old one
    	 }
    
         if(isset($tab_array['reviews'])){
             $new_tab_array['reviews'] = $tab_array['reviews'];// set in new array
    		 unset($tab_array['reviews']);//unset in old one
    	 }
    
        if(isset($tab_array['related_listing'])){
            $new_tab_array['related_listing'] = $tab_array['related_listing'];// set in new array
    		unset($tab_array['related_listing']);//unset in old one
    	}
    	
    	// now we set any remaining tabs that have not been assigned an order
    	foreach($tab_array as $key=>$tab){
    	$new_tab_array[$key]=$tab;
    	}
    
        return $new_tab_array ;
    }
    
    
    #15594

    Patrick
    Lifetime Member
    Post count: 86

    Anyone figure out how to do this?

    I’m thinking of adding a field like “In the Ether” or “No physical location”, then do an If to not show the map tab if selected… can the hook above remove a tab or no?

    #15596

    Paolo
    Site Admin
    Post count: 31206

    Yes it can.

    Thx

    #17930

    frantletle
    Full Member
    Post count: 91

    Thanks for the function for switching tab order. Reviews tend to be most useful for our users.

    I also would rather do as much with custom functions because like you, I want to keep my site fast and don’t need a ton of regular changes to design/functionality.

    I think the function is duplicating the ‘special_offers’ line though

    ** As for hiding empty tabs, +1 here too. **

    #44970

    jkirker
    Lifetime Member
    Post count: 298

    Is there a switch to select which tab is selected by default?

    I notice that the post_profile is always selected by default.

Viewing 15 posts - 1 through 15 (of 17 total)

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

Open Support Ticket