Hide tabs if empty

  • Posts: 7
  • Thank you received: 0
8 years 4 months ago #259754

-- url of the page with the problem -- : www.benevers.bio
-- HikaShop version -- : 2.6.2
-- Joomla version -- : 3.6.4

Is it possible to hide tabs if there are no content in it?
At some of the products i have added a text in an tab i've created: 'recept' but i want to hide that tab if there is no text added. Is that possible?

Last edit: 8 years 4 months ago by nancytoemen.

Please Log in or Create an account to join the conversation.

  • Posts: 83858
  • Thank you received: 13577
  • MODERATOR
8 years 4 months ago #259756

Hi,

Add such code at the beginning of the show_tabular view file:

//LAYOUT show_block_dimensions
$this->setLayout('show_block_dimensions');
$specif_tab_content = trim($this->loadTemplate());
if(!empty($this->fields)){
	//LAYOUT show_block_custom_main
	$this->setLayout('show_block_custom_main');
	$specif_tab_content .= trim($this->loadTemplate());
and then replace the two occurrences of $hide_specs == 0 by:
!empty($specif_tab_content)
in the same view file and that will do it.

Please Log in or Create an account to join the conversation.

Time to create page: 0.055 seconds
Powered by Kunena Forum