WebsiteBaker 2.13.9 R25 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
+-----------------------------+| (1) 2-spalten Block |+-----------------------------+| (2) Block 2 | (3) Block 3 |+-----------------------------+| (4) 2-spalten Block |+-----------------------------+| (5) Block 2 | (6) Block 3 |+-----------------------------+
+-----------------------------+| (1) 2-spalten Block || (4) 2-spalten Block |+-----------------------------+| (2) Block 2 | (3) Block 3 || (5) Block 2 | (6) Block 3 |+-----------------------------+
// Definition of content blocks$block[1] ='MainContent';$block[2] ='Right Block';$block[3] ='Teaser';$block[4] ='Anynews';$block[5] ='Contactbox Left';$block[6] ='Contactbox Right';$block[7] ='Bottom Block';$block[8] ='In-Footer Block';
ob_start(); //fetch MainContentpage_content(1);$page_MainContent = ob_get_clean();ob_start(); //fetch original main contentpage_content(2);$page_RightBlock = ob_get_clean();ob_start(); //fetch original right sidebar contentpage_content(3);$page_Teaser = ob_get_clean();ob_start(); //fetch original right sidebar contentpage_content(4);$page_AnyNews = ob_get_clean();ob_start(); //fetch original right sidebar contentpage_content(5);$contact_leftBlock = ob_get_clean();ob_start(); //fetch original right sidebar contentpage_content(6);$contact_rightBlock = ob_get_clean();ob_start(); //fetch original right sidebar contentpage_content(7);$page_BottomBlock = ob_get_clean();ob_start(); //fetch original right sidebar contentpage_content(8);$page_InFooterBlock = ob_get_clean();
<!-- Main Content --> <?php if(trim($page_RightBlock)!=''){ ?> <div class="w3-container w3-content w3-center w3-padding-8" id="content1" style="max-width:960px;"> <div class="w3-container w3-content w3-left-align w3-padding-0 w3-col m8 l8" id="content2" style="max-width:1190px;"> <?php echo $page_MainContent; ?> </div> <div class="w3-container w3-block w3-left-align w3-row-padding w3-col m4 l4"> <?php echo $page_RightBlock; ?> </div> </div> <?php }else{ ?> <div class="w3-container w3-content w3-center w3-padding-8" id="content1" style="max-width:960px;"> <div class="w3-container w3-block w3-left-align w3-row-padding"> <?php echo $page_MainContent; ?> </div> </div> <?php } ?>
<!-- Anynews block --> <?php if(trim($page_AnyNews)!=''){ ?> <!-- anynewscontent --> <div class="w3-container w3-content w3-center w3-padding-0" id="content4" style="max-width:960px;"> <div class="w3-container w3-block w3-left w3-row-padding"> <?php echo $page_AnyNews; ?> </div> </div> <?php } ?>
<?php if(trim($page_AnyNews)!=''){ ?>....
<?php if(trim($contact_leftBlock)!='' || trim($contact_rightBlock)!='' ){ ?>....
2-spalt, Block L, Block R, Block L, Block R, 2-Spalt,2-Spalt, Block L, Block R
Block L, Block R, Block L, Block R, Block L, Block R 2-spalt
ob_start(); page_content(1); $main = ob_get_clean();ob_start(); page_content(2); $right = ob_get_clean();ob_start(); page_content(3); $left = ob_get_clean();ob_start(); page_content(4); $fulltop = ob_get_clean();ob_start(); page_content(5); $fullbottom = ob_get_clean();ob_start(); page_content(6); $fullwidth = ob_get_clean();
<?php // Top if ($fulltop) { ?> <div id="top" class="bg-1 text-center"><?php echo $fulltop; ?></div> <?php } ?> <div class="container"> <div class="row"> <?php if ($right && $main && $left) { ?> <div id="left" class="col-md-3"><?php echo $left ?></div> <div id="main" class="col-md-6"><?php echo $main ?></div> <div id="right" class="col-md-3"><?php echo $right ?></div> <?php } elseif ($right && $main) { ?> <div id="main" class="col-md-9"><?php echo $main ?></div> <div id="right" class="col-md-3"><?php echo $right ?></div> <?php } elseif ($left && $main) { ?> <div id="left" class="col-md-3"><?php echo $left ?></div> <div id="main" class="col-md-9"><?php echo $main ?></div> <?php } elseif ($main) { ?> <div id="main" class="col-sm-12"><?php echo $main ?></div> <?php } ?> <div style="clear:both;"></div> <?php // Bottom if ($fullbottom) { ?><div id="bottom" class="col-md-12"><?php echo $fullbottom; ?></div> <?php } ?> </div> </div>
@Jacobi22:Alles ist dynamisch - d.h., ich weiß doch jetzt noch nicht, wie das später gefüllt wird. Was meine ich:naja, die Abschnitte können ja frei gewählt werden, also eine Seite mit der Reihenfolge....Siehst Du (oder jmd. anderes), die Contentblöcke sozusagen "einzeln" abzufragen - das würde ja helfen, dann könnte man locker mit PHP eine Schleife bauen.
if(trim($page_RightBlock)!=''
<!-- CONTENT --> <main class="content-grid"><?php if (trim($pageContent2spalten) != '') { ?> <section class="block block-1"><?= $pageContent2spalten; ?></section><?php } ?><?php if (trim($pageContentlinkespalte) != '') { ?> <section class="block block-2"><?= $pageContentlinkespalte; ?></section><?php } ?><?php if (trim($pageContentrechtespalte) != '') { ?> <section class="block block-3"><?= $pageContentrechtespalte; ?></section><?php } ?> </main>....</div> <?php /* nur zum Test */ page_content(1);?>
if (!is_callable('page_content')) { ... function page_content(int $block = 1) { // Get outside objects global $TEXT,$MENU,$HEADING,$MESSAGE; // backwards compability// static $iSections=1; static $i=-1;..... Zeile 228: $block = (($block < 1) ? 1 : $block); if (!\defined('PAGE_CONTENT') || (($block !== 1))){ $page_id = (int)(isset($oApp->page_id) ? $oApp->page_id : PAGE_ID); $sBackLink = $oApp->default_link; SQL!!!! $sSqlSet = ' SELECT `s`.* ,`p`.`viewing_groups` ,`p`.`visibility` ,`p`.`menu_title` ,`p`.`link` ,`s`.`block` FROM `'.TABLE_PREFIX.'sections` `s` INNER JOIN `'.TABLE_PREFIX.'pages` `p` ON `p`.`page_id`=`s`.`page_id` WHERE `s`.`page_id` = '.( int)$page_id.' AND ('.$iNow.' BETWEEN `s`.`publ_start` AND `s`.`publ_end`) AND `s`.`active` = 1 AND `p`.`visibility` NOT IN (\'deleted\',\'none\') AND `s`.`block`='.$block.' ORDER BY `s`.`position`';.... Zeile 259 while(!is_null($aSection = $oSections->fetchAssoc())) {.....Zeile 305 if (!empty($sContent) && $isActive) { $bPrintAnchor = ($bAnchor && ($sSectionIdPrefix == 'none')||($sSectionIdPrefix != 'none')); $sAnchor = "\n".'<div id="'.$sSectionIdPrefix.$section_id.'" class="section m-'.$module.' '.$sAttribute.'" >'; $sBeforeContent = ($bPrintAnchor ? $sAnchor : ''); $sAfterContent = ($bPrintAnchor ? '</div><!-- INFO '.$module.$section_id.' -->' : '');HIER!!!! echo $sContent = ltrim($sBeforeContent."\n".$sContent."\n".$sAfterContent."\n"); } }// no more sections found, so break e.g from multiselection if ($iSections == 0){break;} } // end while }..... } // end function page_content }
Array ( [0] => Array ( [1] =>Block 1, 2 Spalten ) [1] => Array ( [2] =>Block 2 (Spalte links) ) [2] => Array ( [3] =>Block 2 (Spalte rechts) )[3] => Array ( [1] =>Block 4 (2 Spalten) ) [4] => Array ( [2] =>noch einmal linke spalte ) )
$block = (($block < 1) ? 1 : $block);
Die Einträge direkt hinter wysiwyg: hast Du die da "einmontiert"?Weil, ich habe es wirklich getestet: [Mainblock 1] und [Mainblock 2
[0] => Array ( [1] =>Block 1, 2 Spalten )[1] => Array ( [2] =>Block 2 (Spalte links) )[2] => Array ( [3] =>Block 2 (Spalte rechts) )[3] => Array ( [1] =>Block 4 (2 Spalten) )[4] => Array ( [2] =>noch einmal linke spalte ) )
$fulltop = false;ob_start(); page_content(1); $main = ob_get_clean();if ($fulltop) { ....
Block Main. Diese gleichen Blöcke werden zusammengefaßt zu einem, unabhängig von der Position in der Sectionübersicht.
in der index.php deines Frontend-Templates wird die Funktion page_content() aufgerufen. Der Aufruf ist mit oder ohne eine Zahl möglich. Wird keine Blocknummer übermittelt, ist es immer Block 1. Das regelt diese Zeile, $Block ist der numerische Wert im Funktionsaufruf, also z.b. page_content(3) )Code: Code: [Select]$block = (($block < 1) ? 1 : $block);Du mußt also sicherstellen, das du nicht page_content() und page_content(1) gemeinsam im Template verwendest, sonst können Abschnitte doppelt dargestellt werden.
function page_content(int $block = 1) {
ausgabe page_content()[b]Block 1, 2 Spalten Block 4 (2 Spalten) [/b] -------ist identisch mit -------------------ausgabe page_content(1)[b]Block 1, 2 Spalten Block 4 (2 Spalten) [/b]--------------------------ausgabe page_content(2)[b]Block 2 (Spalte links) noch einmal linke spalte [/b]
... } else { // Searchresults! But also some special pages, // e.g. guestbook (add entry), news (add comment) uses this \ob_start(); // fetch original content require(PAGE_CONTENT); $sContent = ob_get_clean(); // Apply Filters if (\is_callable('OutputFilterApi')) { $sContent = OutputFilterApi('OpF?arg=special', $sContent); } echo $sContent; }