Template Problems

Ruud

Try using WB_PATH instead of WB_URL.

@Availor:
You might want to change that in your tutorial. WB_URL will not work.

Ruud
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

stormswimmer

I'm trying to add a global block to my template. However, I have been unsuccessful. I read the tutorial at http://www.websitebakerden.com/pages/posts/adding-global-block-to-show-on-all-pages24.php and followed the directions. I created http://balanceyourmetabolism.com/WebsiteBaker-2.7.0/wb/pages/blocks/links.php and http://balanceyourmetabolism.com/WebsiteBaker-2.7.0/wb/pages/blocks/blocks1.php then inserted<?php include (WB_URL."/pages/blocks/links.php"); ?> and <?php include (WB_URL."/pages/blocks/blocks1.php"); ?> into my template. Have I overlooked something?

stormswimmer


doc

#4
Hello,

please read the help of the forum, the PHP documentation and the WB documentation available before posting.

Adding long code as text file: read here (attach long code as file is the better choice)
What is the PHP function include for: read here (also a good starting point for other PHP questions)
WB documentation about templates: read here

Christian

stormswimmer

Here is my info.php file.
<?php

/*

 WebsiteBaker Project <http://www.WebsiteBaker.org/>
 Copyright (C) 2004-2006, Ryan Djurovich

 WebsiteBaker is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 WebsiteBaker is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with WebsiteBaker; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

*/


$template_directory 'Multiflex-3';
$template_name 'Multiflex-3';
$template_version '1.0';
$template_platform '2.x';
$template_author 'Erik Coenjaerts (http://www.coenjaerts.com)';
$template_license 'GNU General Public License';
$template_description 'Original Design by Wolfgang (http://www.1-2-3-4.info)/Modified for WB by Erik Coenjaerts';
$menu[1]='Main Menu';
$menu[2]='Top Menu';
$menu[3]='Extra Menu';
$block[2]='Sidebar';
$block[3]='News';

?>


What does this code do in index.php?

<?php include (WB_URL."/pages/blocks/latest-news.php"); ?>

Availor

You have only one "page_content();" If you want to add blocks you must define them in info.php

Add just above the last line of "?>" $block[2]='content2';  etc.... and in the index file add page_content(2); wherever you want it to appear.

http://help.websitebaker.org/pages/en/advanced-docu/designer-guide/content-blocks.php

stormswimmer

Hey,

I am having trouble with the template multiflex-3. I made some changes in the CSS file, but for some reason I can't change the information in the section blocks. I am new to WebsiteBaker so perhaps I am managing the sections incorrectly. Here is the index.php file. Thank you

stormswimmer

<?php

/*

 WebsiteBaker Project <http://www.WebsiteBaker.org/>
 Copyright (C) 2004-2006, Ryan Djurovich

 WebsiteBaker is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 WebsiteBaker is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with WebsiteBaker; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

*/

?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">


<!--  Version: Multiflex-3 Version 1.8 / Layout-4         -->
<!--  Date:    May 22, 2007                               -->
<!--  Author:  G. Wolfgang                                -->
<!--  License: Fully open source without restrictions.    -->
<!--           Please keep footer credits with a link to  -->
<!--           Wolfgang (www.1-2-3-4.info). Thank you!    -->

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=<?php if(defined('DEFAULT_CHARSET')) { echo     DEFAULT_CHARSET; } else { echo 'utf-8'; }?>" />
  <meta http-equiv="cache-control" content="no-cache" />
  <meta http-equiv="expires" content="3600" />
  <meta name="revisit-after" content="2 days" />
  <meta name="robots" content="index,follow" />
  <meta name="author" content="Design: Wolfgang (www.1-2-3-4.info) / Modified: Erik Coenjaerts" />
  <meta name="distribution" content="global" />
  <meta name="description" content="<?php page_description(); ?>" />
  <meta name="keywords" content="<?php page_keywords(); ?>" />
  <link rel="stylesheet" type="text/css" media="screen,projection,print" href="<?php echo TEMPLATE_DIR?>/layout_setup.css" />
  <link rel="stylesheet" type="text/css" media="screen,projection,print" href="<?php echo TEMPLATE_DIR?>/layout_text.css" />
  <title><?php page_title(); ?></title>
  <link rel="icon" type="image/x-icon" href="./img/favicon.ico" />
</head>

<!-- Global IE fix to avoid layout crash when single word size wider than column width -->
<!--[if IE]><style type="text/css"> body {word-wrap: break-word;}</style><![endif]-->

<body>
  <!-- Main Page Container -->
  <div class="page-container">

    <!-- For alternative headers START PASTE here -->

    <!-- A. HEADER -->     
    <div class="header">
        <!-- Navigation Level 1 -->
        <div class="nav1">

            <?php show_menu2(2SM2_ROOTSM2_START); ?>

        </div>
     
      <!-- A.2 HEADER MIDDLE -->
      <div class="header-middle"> 
      <img src="<?php echo TEMPLATE_DIR?>/img/green.jpg" alt="Image description" /> 
   
        <!-- Site message -->
        <div class="sitemessage">
           
        </div>       
      </div>
     
      <!-- A.3 HEADER BOTTOM -->
      <div class="header-bottom">

        <!-- Navigation Level 2 (Drop-down menus) -->
        <div class="nav2">

          <!-- Navigation item -->
          <ul>
          <?php show_menu2(1SM2_ROOTSM2_ALL,SM2_ALL,'<li>[a][menu_title]
                        [if(class==menu-expand){<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><ul>}]
                        [if(class!=menu-expand){</a>}]
                        [if(class!=menu-last){</li>}]
                        [if(class==menu-last){</li></ul><!--[if lte IE 6]></td></tr></table></a><![endif]-->}]'
,'','',''); ?>

          </ul>

        </div>
     </div>

      <!-- A.4 HEADER BREADCRUMBS -->

      <!-- Breadcrumbs -->
      <div class="header-breadcrumbs">

        <?php show_menu2(0SM2_ROOTSM2_CURRSM2_CRUMB'<li>[a][menu_title]</a></li>','','[if(level>0){}][if(level==0){<ul>}]','');?>
        </ul>

        <!-- Search form -->
        <?php if(SHOW_SEARCH) { ?>
          <div class="searchform">
            <form name="search" action="<?php echo WB_URL.'/search/index'.PAGE_EXTENSION?>" method="post">
              <fieldset>
                <input name="string" class="field"  value=" <?php echo $TEXT['SEARCH']; ?>..." />
                <input type="submit" name="button" class="button" value="GO" />
              </fieldset>
            </form>
          </div>
        <?php ?>
      </div>
    </div>

    <!-- For alternative headers END PASTE here -->

    <!-- B. MAIN -->
    <div class="main" style="background-color:#FFFFFF;">

      <!-- B.1 MAIN NAVIGATION -->
      <div class="main-navigation">

        <!-- Navigation Level 3 -->
        <div class="round-border-topright"></div>
        <h1 class="first">Other Menu</h1>

        <!-- Subtitle -->
        <h2>Handy Stuff</h2>

        <!-- Navigation with bullets -->
        <dl class="nav3-bullet">
          <?php show_menu2(3SM2_ROOTSM2_ALLSM2_ALL,'[if(level>0){<dd>}][if(level==0){<dt>}][a][menu_title]</a>[if(level>0){</dd>}][if(level==0){</dt>}]');?>
        </dl>
                       
        <!-- Login -->
        <?php if(FRONTEND_LOGIN AND !$wb->is_authenticated()) {?>
          <h1><?php echo $TEXT['LOGIN']; ?></h1>
          <div class="loginform">
            <form method="post" action="<?php echo LOGIN_URL?>">
              <fieldset>
                <p><label for="username" class="top"><?php echo $TEXT['USERNAME']; ?></label><br />
                  <input type="text" name="username" id="username_1" tabindex="1" class="field" onkeypress="return webLoginEnter(document.loginfrm.password);" value="" /></p>
                <p><label for="password_1" class="top"><?php echo $TEXT['PASSWORD']; ?></label><br />
                  <input type="password" name="password" id="password_1" tabindex="2" class="field" onkeypress="return webLoginEnter(document.loginfrm.cmdweblogin);" value="" /></p>
                <p><input type="submit" name="submit" class="button" value="<?php echo $TEXT['LOGIN']; ?>"  /></p>
                <p><a href="<?php echo FORGOT_URL?>"><?php echo $TEXT['FORGOT_DETAILS']; ?></a></p>
              <?php if(is_numeric(FRONTEND_SIGNUP)) { ?>
                <p><a href="<?php echo SIGNUP_URL?>"><?php echo $TEXT['SIGNUP']; ?></a></p>
              <?php ?>
              </fieldset>
            </form>
          </div>
        <?php } elseif(FRONTEND_LOGIN AND $wb->is_authenticated()) {?>
          <h1><?php echo $TEXT['LOGIN']; ?></h1>
          <div class="loginform">
            <form name="logout" action="<?php echo LOGOUT_URL?>" method="post">
                <p><?php echo $TEXT['LOGGED_IN']; ?></p>
                <p><?php echo $TEXT['WELCOME_BACK']; ?>,<br /> <a href="<?php echo PREFERENCES_URL?>"><?php echo $wb->get_display_name(); ?></a></p>
                <input type="submit" name="submit" value="<?php echo $MENU['LOGOUT']; ?>" />
            </form>
          </div>
        <?php ?>

      </div>

      <!-- B.1 MAIN CONTENT -->
      <div class="main-content">

        <!-- Pagetitle -->
        <h1 class="pagetitle"><?php page_title('','[PAGE_TITLE]'); ?></h1>
        <?php page_content(); ?>

      </div>

      <!-- B.3 SUBCONTENT -->
      <div class="main-subcontent" style="background-color:#FFFFFF;">

        <!-- Subcontent unit -->
        <div class="subcontent-unit-border">
          <div class="round-border-topleft"></div><div class="round-border-topright"></div>
          <h1>Latest News</h1>
          <?php include (WB_URL."/pages/blocks/latest-news.php"); ?>
        </div>

        <!-- Subcontent unit -->
        <div class="subcontent-unit-border-blue">
          <div class="round-border-topleft"></div><div class="round-border-topright"></div>
          <h1 class="blue">Blue - Border</h1>
          <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
        </div>

        <!-- Subcontent unit -->
        <div class="subcontent-unit-border-green">
          <div class="round-border-topleft"></div><div class="round-border-topright"></div>
          <h1 class="green">Green - Border</h1>
          <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
        </div>

        <!-- Subcontent unit -->
        <div class="subcontent-unit-border-orange">
          <div class="round-border-topleft"></div><div class="round-border-topright"></div>
          <h1 class="orange">Orange - Border</h1>
          <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
        </div>

        <!-- Subcontent unit -->
        <div class="subcontent-unit-noborder">
          <div class="round-noborder-topleft"></div><div class="round-noborder-topright"></div>
          <h1>Grey - No border</h1>
          <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
        </div>

        <!-- Subcontent unit -->
        <div class="subcontent-unit-noborder-blue">
          <div class="round-noborder-topleft"></div><div class="round-noborder-topright"></div>
          <h1 class="blue">Blue - No border</h1>
          <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
        </div>

        <!-- Subcontent unit -->
        <div class="subcontent-unit-noborder-green">
          <div class="round-noborder-topleft"></div><div class="round-noborder-topright"></div>
          <h1 class="green">Green - No border</h1>
          <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
        </div>

        <!-- Subcontent unit -->
        <div class="subcontent-unit-noborder-orange">
          <div class="round-noborder-topleft"></div><div class="round-noborder-topright"></div>
          <h1 class="orange">Orange - No border</h1>
          <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
        </div>

      </div>
    </div>

    <!-- C. FOOTER AREA -->

    <div class="footer">
      <p>Copyright &copy; 2007 <?php page_title('','[WEBSITE_TITLE]'); ?> | All Rights Reserved</p>
      <p class="credits">Design by <a href="http://1-2-3-4.info/" title="Designer Homepage">G. Wolfgang</a>  | Modified by <a href="#" title="Modifyer Homepage">Your Name</a> | Powered by <a href="http://www.WebsiteBaker.org/" target="_blank">WebsiteBaker</a></p>
    </div>
  </div>

</body>
</html>