Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    303
    Plugin Contributions
    3

    Default sidebox problem...

    I am attempting to "create" a sidebox by editing a mod designed for the header. I have it showing up but my new side box auto fill with the content of whatever sidebox is above it and prints the desired content below the box.

    I haven't been able to figure this one out

    store is here

    Any help is greatly appreciated, thx

  2. #2
    Join Date
    May 2009
    Posts
    1,254
    Plugin Contributions
    3

    Default Re: sidebox problem...

    Why don't you use blank sidebox mod instead the one for the header??

  3. #3
    Join Date
    Feb 2008
    Posts
    1,336
    Plugin Contributions
    1

    Default Re: sidebox problem...

    You should arrange the code in a sidebox form. You can't just take a block of code that has a 700px width and drop it in a sidebox and expect it to rearrange itself. This is just an example but you should arrange the code based on a proper sidebox logic.

  4. #4
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    303
    Plugin Contributions
    3

    Default Re: sidebox problem...

    Quote Originally Posted by keneso View Post
    Why don't you use blank sidebox mod instead the one for the header??
    I will give it a try using the blank as my template. The mod I am trying to get to the sidebox is this one - product finder

    Quote Originally Posted by CoolCarPartsOnline View Post
    You should arrange the code in a sidebox form. You can't just take a block of code that has a 700px width and drop it in a sidebox and expect it to rearrange itself. This is just an example but you should arrange the code based on a proper sidebox logic.
    This is where I get lost....
    I am not using any of the orig css for the product finder, so I was hoping the width wouldn't be an issue.

  5. #5
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    303
    Plugin Contributions
    3

    Default Re: sidebox problem...

    being a newbie to php coding I have ask "one of those" questions...

    for the content of the sidebox I want to use php,
    so I would take this line of php code (for example):
    echo "<li>";
    and make it:
    $content .= 'echo "<li>"';
    or
    $content .= 'echo "<li>";';

    thx

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: sidebox problem...

    To add <li> to the output content variable, you would use

    $content .= '<li>';

    echo "<li>"; outputs the <li> to the page immediately, which is bad if the code hasn't sent the HTML <head> info yet.
    Last edited by gjh42; 24 Jan 2011 at 09:08 PM.

  7. #7
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    303
    Plugin Contributions
    3

    Default Re: sidebox problem...

    Quote Originally Posted by gjh42 View Post
    To add <li> to the output content variable, you would use

    $content .= '<li>';

    echo "<li>"; outputs the <li> to the page immediately, which is bad if the code hasn't sent the HTML <head> info yet.
    ok, good to know, thx

  8. #8
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    303
    Plugin Contributions
    3

    Default Re: sidebox problem...

    Ok I'm sure this is absurdly easy but I'm it's giving me !

    This is the code I am trying to put into the side box -
    Code:
    <?php 
    	 echo "<form action=''>";			
    ?>
        <ul class="navMain">
          <?php
       echo "<li>";
       $model1[]=array('id'=>'','text'=>TEXT_PLEASE_SELECT);
    	 if(isset($_REQUEST['cPath1'])){
    	 $value=$_REQUEST['cPath1'];
    	 }	 
    	 echo '<span id="pf_title">'.strip_tags(TEXT_FIND_ALL_PRODUCTS).'</span>
    	 <span class="pf_selectbox_name">'.TEXT_MAKE . '</span>' . zen_draw_pull_down_menu('cPath1',array_merge($model1,zen_get_category_tree()),$value, 'id="cPath" class="pf_selectbox_text"'); 
    	 echo "</li>\n";
       
    	echo '<li>';   
    	echo '<noscript>';
    echo zen_my_image_submit(PF_NOSCRIPT_SUBMIT, 'Go');
             if($_REQUEST['cPath1']!=""){
                   $value=$_REQUEST['cPath1'];
    			   $dropdownArray=zen_get_category_tree($value);
             }
    echo "</noscript>";
     echo "</li>\n";    
    
    echo "<li>";
    	  $modulePath="".DIR_WS_CATALOG;
    	  echo zen_draw_hidden_field('basemodulepath',$modulePath,'id="basemodulepath" ');
    	 $model=array();
    	 $model[]=array('id'=>'',
    	                 'text'=>TEXT_PLEASE_SELECT
    					 );
    	   if($_REQUEST['cPath1']!=""){
    	    $model=array_merge($model,$dropdownArray);
    	    }
    	if(isset($_REQUEST['select_model'])){
    	$value=$_REQUEST['select_model'];
    	}
    	 echo '<span class="pf_selectbox_name">' . TEXT_MODEL .'</span>' 
    	 . zen_draw_pull_down_menu('select_model', $model, $value, 'id="select_model" class="pf_selectbox_text"'); 
     echo "</li>\n";
    
    echo "<li>";
    echo "<noscript>";
    if($_REQUEST['select_model']!=""){
                   $value=$_REQUEST['select_model'];
    			   $dropdownArray=zen_get_category_tree($value); 
             }
    echo zen_my_image_submit(PF_NOSCRIPT_SUBMIT, 'Go');	 
    echo "</noscript>";
     echo "</li>\n";
    
    echo "<li>";
    	 $year=array();
    	 $year[]=array('id'=>'',
    	                 'text'=>TEXT_PLEASE_SELECT
    					 );
    	  if($_REQUEST['select_model']!=""){
    	    $year=array_merge($year,$dropdownArray);
    	    }				 				 
    if(isset($_REQUEST['cPath'])){
              $value=$_REQUEST['cPath'];
    }
    if($_REQUEST['select_model']!=""){
    	 echo '<span class="pf_selectbox_name">' . TEXT_YEAR . '</span>' . 
    	 zen_draw_pull_down_menu('cPath',$year , $value, 'id="select_year" class="pf_selectbox_text"');
    	 }
    else {
    	 echo '<span class="pf_selectbox_name">' . TEXT_YEAR .'</span>' .
    	 zen_draw_pull_down_menu('cPath22',$year , $value, 'id="select_year" class="pf_selectbox_text"');
    }	 
    echo "</li>\n";
    
    echo "<li>";
    echo "<noscript>";
    if($_REQUEST['cPath']!=""){
             $value=$_REQUEST['cPath'];
    	     }
    echo zen_my_image_submit(PF_NOSCRIPT_SUBMIT, 'Go');
    echo "</noscript>";
     echo "</li>\n";
    ?>
        </ul>
        </form>


    I changed the code to this and the page stops loading when it should load this -
    Code:
    <?php
    /**
     * blank sidebox - allows a blank sidebox to be added to your site
     *
     * @package templateSystem
     * @copyright 2007 Kuroi Web Design
      * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: blank_sidebox.php 2007-05-26 kuroi $
     */
    
      $content = '';
      $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
    
      // Replace the text and HTML tags between the apostophes on lines 19 and 20.
      // Use as many or as few lines using this model as you need for your custom content.
      // If you have a multilingual site define your text in the languages/YOUR_LANGUAGE/extra_definitions/blank_sidebox_defines.php and include it as shown in line 19.
      // If your site is monolingual, you can put the text right here as shown on line 20 (and nobody will know!)
      // $content .= '<p>' . TEXT_BLANK_SIDEBOX . '</p>';
     
      $content .= 'echo "<form action=''>"';			
      $content .= '<ul class="navMain">';
      $content .= '<li>';
      $content .= '($model1[]=array('id'=>'','text'=>TEXT_PLEASE_SELECT); if(isset($_REQUEST['cPath1'])){$value=$_REQUEST['cPath1'];})';	 
    	 
      $content .= '<span class="pf_selectbox_name">'.TEXT_MAKE . '</span>' . zen_draw_pull_down_menu('cPath1',array_merge($model1,zen_get_category_tree()),$value, 'id="cPath" class="pf_selectbox_text"')';
       
      $content .= '</li>'; 
      $content .= '<li>';
      $content .= '$modulePath="".DIR_WS_CATALOG';
      $content .= 'echo zen_draw_hidden_field('basemodulepath',$modulePath,'id="basemodulepath" ')';
    	 $content .= '$model=array()';
    	 $content .= '($model[]=array('id'=>'',
    	                 'text'=>TEXT_PLEASE_SELECT
    					 );
    	   if($_REQUEST['cPath1']!=""){
    	    $model=array_merge($model,$dropdownArray);
    	    }
    	if(isset($_REQUEST['select_model'])){
    	$value=$_REQUEST['select_model'];
    	})';
    	 $content .= 'echo '<span class="pf_selectbox_name">' . TEXT_MODEL .'</span>' 
    	 . zen_draw_pull_down_menu('select_model', $model, $value, 'id="select_model" class="pf_selectbox_text"')'; 
     $content .= '</li>';
    
    $content .= '<li>';
    
    	 $content .= '$year=array()';
    	 $content .= '($year[]=array('id'=>'',
    	                 'text'=>TEXT_PLEASE_SELECT
    					 );
    	  if($_REQUEST['select_model']!=""){
    	    $year=array_merge($year,$dropdownArray);
    	    }				 				 
    if(isset($_REQUEST['cPath'])){
              $value=$_REQUEST['cPath'];
    }
    if($_REQUEST['select_model']!=""){
    	 echo '<span class="pf_selectbox_name">' . TEXT_YEAR . '</span>' . 
    	 zen_draw_pull_down_menu('cPath',$year , $value, 'id="select_year" class="pf_selectbox_text"');
    	 }
    else {
    	 echo '<span class="pf_selectbox_name">' . TEXT_YEAR .'</span>' .
    	 zen_draw_pull_down_menu('cPath22',$year , $value, 'id="select_year" class="pf_selectbox_text"');
    })';	 
    $content .= '</li>';
    
     $content .= '</li>';
    
        $content .= '</ul>';
        $content .= '</form>';
    
      $content .= '</div>';
    ?>
    for now I'm off to the wild web to see what else I can learn about php coding... prolly just enuf to get myself into trouble!

  9. #9
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: sidebox problem...

    PHP Code:
    $content .= 'echo "<form action=''>"'
    This has a couple of problems.
    You don't use echo as part of the content of a PHP string variable - it is only for making immediate output. This will just not work as desired, and possibly cause an HTML error in the page.

    The first of the two single quotes in action='' will be interpreted by PHP as closing the string opened by 'echo, and then another single quote without intervening operators will cause a PHP error.
    PHP Code:
    $content .= '<form action="">'

  10. #10
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    303
    Plugin Contributions
    3

    Default Re: sidebox problem...

    gjh42-
    Thanks for the direction but unfortunately...
    Another attempt = another fail!

    PHP Code:
    $content '';
      
    $content .= '<div id="' str_replace('_''-'$box_id 'Content') . '" class="sideBoxContent">';
      
    //$content .= '<p>' . TEXT_BLANK_SIDEBOX . '</p>';
      
    $content .= '<form action="">';            
      
    $content .= '<ul>';
      
    $content .= '<li>';
      
    $content .= $model1[]=array('id'=>'','text'=>TEXT_PLEASE_SELECT) . if(isset($_REQUEST['cPath1'])){$value=$_REQUEST['cPath1'];};     
      
    $content .= '<span class="pf_selectbox_name">' TEXT_MAKE '</span>' zen_draw_pull_down_menu('cPath1',array_merge($model1,zen_get_category_tree()),$value'id="cPath" class="pf_selectbox_text"');
      
    $content .= '</li>\n'
      
    $content .= '<li>';
      
    $content .= $modulePath="".DIR_WS_CATALOG;
      
    $content .= zen_draw_hidden_field('basemodulepath',$modulePath,'id="basemodulepath" ');
      
    $content .= $model=array();
      
    $content .= $model[]=array('id'=>'' 'text'=>TEXT_PLEASE_SELECT); . if($_REQUEST['cPath1']!=""){$model=array_merge($model,$dropdownArray);} . if(isset($_REQUEST['select_model'])){$value=$_REQUEST['select_model'];};
      
    $content .=  '<span class="pf_selectbox_name">' TEXT_MODEL .'</span>' zen_draw_pull_down_menu('select_model'$model$value'id="select_model" class="pf_selectbox_text"'); 
      
    $content .= '</li>\n';
      
    $content .= '<li>';
      
    $content .= $year=array();
      
    $content .= $year[]=array('id'=>'','text'=>TEXT_PLEASE_SELECT) . if($_REQUEST['select_model']!=""){$year=array_merge($year,$dropdownArray);} . if(isset($_REQUEST['cPath'])){$value=$_REQUEST['cPath'];} . if($_REQUEST['select_model']!=""){'<span class="pf_selectbox_name">' TEXT_YEAR '</span>' zen_draw_pull_down_menu('cPath',$year $value'id="select_year" class="pf_selectbox_text"');} . else {'<span class="pf_selectbox_name">' TEXT_YEAR .'</span>' zen_draw_pull_down_menu('cPath22',$year $value'id="select_year" class="pf_selectbox_text"');});     
      
    $content .= '</li>\n';
      
    $content .= '</ul>';
      
    $content .= '</form>';
      
    $content .= '</div>'
    I'm guessing that the issue is now in the if statements... but that's just a guess.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Sidebox problem
    By jolotull in forum Addon Sideboxes
    Replies: 11
    Last Post: 8 May 2011, 01:32 AM
  2. sidebox problem !
    By alhakeem2001 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 2 Dec 2009, 07:47 PM
  3. sidebox problem...
    By irascible in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 2 Nov 2006, 07:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg