Exclude selected tabs from detail page (if empty)
This topic contains 16 replies, has 9 voices, and was last updated by nickd 8 years, 10 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
July 1, 2014 at 1:53 pm #6975
There is a setting to exclude tabs, is it possible to exclude tabs only if they are empty? This would be very helpful. Thanks
July 1, 2014 at 3:12 pm #6987I agree, this would be very useful.
July 1, 2014 at 6:24 pm #7026At 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
July 1, 2014 at 7:27 pm #7045How do I rally the troops?
July 1, 2014 at 7:28 pm #7046+1 for an option to exclude tabs IF they are empty. And an option to rearrange the tab orders too will be nice.
July 1, 2014 at 7:28 pm #7047just adding some tags so others can find this.
July 1, 2014 at 7:30 pm #7048This reply has been marked as private.July 1, 2014 at 7:40 pm #7049+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.
July 2, 2014 at 11:36 am #7175Paulo, it looks like we have 4 +1’s are you looking for a lot more to consider the benefit of this feature?
ThanksJuly 2, 2014 at 6:23 pm #7286Yes, 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
July 2, 2014 at 8:45 pm #7305Just 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 ; }
September 16, 2014 at 5:25 pm #15594Anyone 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?
September 16, 2014 at 5:37 pm #15596Yes it can.
Thx
October 10, 2014 at 6:07 am #17930Thanks 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. **
July 8, 2015 at 12:20 am #44970Is there a switch to select which tab is selected by default?
I notice that the post_profile is always selected by default.
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket