WebsiteBaker 2.13.9 is now available!
R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WBhttps://forum.websitebaker.org/index.php/topic,32355.0.html
<div> <ul class="tabs"> <li><a href="#">Tab 1</a></li> <li><a href="#">Tab 2</a></li> <li><a href="#">Tab 3</a></li> </ul> <div class="pane">Content 1</div> <div class="pane">Content 2</div> <div class="pane">Content 3</div></div>
<?php // this line is not part of the droplet, but just to color the code below$tabs .= '<li><a href="#">'.$tab.'</a></li>';global $database, $wb;$sections=explode(",",$section);reset($sections);array_unshift($sections," ");while($sectionid=next($sections)){ $get_content = $database->query("SELECT content FROM ".TABLE_PREFIX."mod_wysiwyg WHERE section_id = '$sectionid'"); while ( $fetch_content = $get_content->fetchRow()){ $contentlist .= '<div class="pane">'.$content.($fetch_content['content']).'</div>'; }}$wb->preprocess($content);return '<div><ul class="tabs">'.$tabs.'</ul>'.$contentlist.'</div>';
<ul class="tabs"> <li><a href="#">Tab 1</a></li> <li><a href="#">Tab 2</a></li> <li><a href="#">Tab 3</a></li> </ul>
<ul class="tabs"> <li><a href="#">Tab 1,Tab2,Tab3</a></li> </ul>
I guess I need to use some loop like is used for the content sections, but I don't succeed in creating it... My droplet call is [[test?tab=Tab 1,Tab2,Tab3§ion=47,48,49]]Please give me a hand here
<?php // this line is not part of the droplet, but just to color the code below$atabs = explode(",",$tab);$stabs = '';global $database, $wb;$sections=explode(",",$section);reset($sections);array_unshift($sections," ");while($sectionid=next($sections)){ $stabs .= '<li><a href="#">'.(array_shift($atabs)).'</a></li>'; $get_content = $database->query("SELECT content FROM ".TABLE_PREFIX."mod_wysiwyg WHERE section_id = '$sectionid'"); while ( $fetch_content = $get_content->fetchRow()){ $contentlist .= '<div class="pane">'.$content.($fetch_content['content']).'</div>'; }}$wb->preprocess($content);return '<div><ul class="tabs">'.$stabs.'</ul>'.$contentlist.'</div>';