Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Automatic products tab


  • You cannot reply to this topic
No replies to this topic

#1 Gyakutsuki

  • Community Member
  • 118 posts
  • Real Name:Loic Richard
  • Gender:Male
  • Location:Quebec

Posted 07 December 2011, 01:01

Hello,

I try to develop a new product tab module. All i seen is manual.

If in my description I have <h3> then the tab is created automaticly

it does'nt work again fine, but if you can help me, i think it will be a good contriburion.

delete line 135 : <?php echo stripslashes($product_info['products_description']); ?>

<style>
.rte {
	color: black;
	text-align: left;
}
.clear {
	clear: both;
}
/*couleur onglet*/
#more_info_tabs li a.selected {
	background-color: #B5A432;
	color: #FFFFFF;
}
#more_info_tabs li a {
	border-left: 1px solid #FFFFFF;
	color: #FFFFFF;
	height: auto;
	padding: 7px 20px !important;
}
ul.idTabsShort li a.selected {
	border: medium none;
	color: black;
	padding: 5px 15px 9px 0;
}
ul.idTabs li a.selected {
	height: auto;
	padding-left: 0;
}
ul.idTabsShort li a {
	border: medium none;
	color: #999999;
	font-weight: normal;
	padding: 8px 12px 9px 0 !important;
	width: auto;
}
ul.idTabs li a {
	color: #0066CC;
	display: block !important;
	font-weight: bold;
	height: 10px;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
}
ul.idTabsShort li {
	line-height: 15px !important;
}
ul.idTabsShort {
	border-style: solid none dotted;
}
ul.idTabs {
	list-style-type: none;
}
</style>
<?php
		$products_description = stripslashes($product_info['products_description']);
		 $products_description_content .= '<script type="text/javascript">jQuery(document).ready(function () { jQuery(\'#idTab1\').remove(); jQuery(\'#more_info_tab_more_info\').parent().remove(); });</script>' . "\n";
 
// tab menu
		 $return = "";
   $first = true;
	if (strpos($desc, '<h3>') !== FALSE) {
	 $cut = explode('<h3>', trim($desc));
	 foreach ($cut as $k => $part) {
	  if (trim($part) != "") {
	   if (strpos($part, "</h3>") !== FALSE) {
		$t = substr($part, 0, strpos($part, '</h3>'));
		$return .= '<li><a href="#idTab100' . $k . '"' . ($first ? 'class="selected"' : '' ) . '>' . $t . '</a></li>' . "\n";
		$first = false;
	   }
	  }
	 }
	}
 
// content menu in the tab
	   $return1 = "";
	$desc = $products_description;
	if (strpos($desc, '<h3>') !== FALSE) {
	 $cut = explode('<h3>', trim($desc));
	 foreach ($cut as $k => $part) {
	  if (trim($part) != "") {
	   if (strpos($part, "</h3>") !== FALSE) {
		$r = substr($part, strpos($part, '</h3>') + 5);
		$return1 .= '<div id="idTab100' . $k . '" class="rte">' . $r . '</div>' . "\n";
	   }
	  }
	 }
				  }
//		  $products_description_content .= '<div class="clear" id="more_info_block">' . "\n";
		  $products_description_content .= '<div  id="more_info_block">' . "\n";
		  $products_description_content .= '<ul class="idTabs idTabsShort" id="more_info_tabs">' . "\n";
		  $products_description_content .= ' '.$return . $return1 . "\n";
		  $products_description_content .= '</ul>' . "\n";
		  $products_description_content .= '</div>' . "\n";
//		  $products_description_content .= '</div>' . "\n";
 
echo $products_description_content;
?>

Regards
-----------------------------------------
Regards

gyakutsuki