Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    May 2007
    Posts
    23
    Plugin Contributions
    0

    Default Main page does not need sidebox... help!

    Hi guys,

    The main page of my website does not need any sidebox, just a few buttons like About us, News, Contact us, Products. Click any button of them will jump to the subpage which has side box and layout simliar to zen-cart default. So my question is how and where I could configure or change code to make the main page as mentioned above ?

    Thanks for the help! :)

  2. #2
    Join Date
    Dec 2004
    Location
    New York, USA
    Posts
    1,198
    Plugin Contributions
    0

    Default Re: Main page does not need sidebox... help!

    Take a look at tpl_main_page.php (template file). You'll see in the beginning of the file comments on how to do this.

  3. #3
    Join Date
    May 2007
    Posts
    23
    Plugin Contributions
    0

    Default Re: Main page does not need sidebox... help!

    Thank you for your help, lib99!

    Well, I forgot to mention that the first page of my website is like image webpage, its layout is completely different with all the other pages. So I got confused how I could make this page to be index.php which is already provided by zen-cart. If it were not the first page (index.php), I could use ez-page to add this page. I also tried changing tpl_main_page.php, like deleting the header (index.php will not have header image), but I found all the other pages are shown without header too.

    Well, I am quite new to php and zen-cart, could anyone give me more instructions? I am in a rush to finish this website. I just bought zen-cart book a couple days ago, does it contain such kind of information?

    Thanks,

  4. #4

    Default Re: Main page does not need sidebox... help!

    If I'm understanding you, you need the first page the customer sees to NOT have a sidebox, and the rest of the pages to HAVE a sidebox. If that is the case then you need to look at this page which explains how to use tpl_main_page to control that. For example, I use a left column only but not on any of the checkout or informational links. Only in the catalog.

    https://www.zen-cart.com/tutorials/i...hp?article=233

    I hope that helps, and please redirect if I'm not understanding you correctly.

    You can see what I mean on my site at www.thepearltrader.com which is under construction as well.

    -J

  5. #5
    Join Date
    May 2007
    Posts
    23
    Plugin Contributions
    0

    Default Re: Main page does not need sidebox... help!

    Thank you red8ii8. Well, I might not explain clearly. My first page (index.php) will be completely different compared with other pages ( the header image is different with other pages too). It only have some images and links, two paragraph on About us and News. The problem is that I can use ez-pages to add a page easily if this were not the first page (index.php). Unfortunately, this is the first page that will be shown when someone open the website. So I do not know how to do this. If I edit this page through tpl_main_page , then all the other pages (they have the same layout like default zen cart layout) will change.

    Currently, I have a temporary solution, I wrote a main.php without using zen-cart provided files. When someone open the website it will display this main.php first, this file contains links to zen-cart template that will show the zen-cart layout. The problem using this method is that I can not use admin to edit this file since it is outside zen-cart system. Also, I have to write code in this file to connect database to get news. Well, I am new to php and zen-cart, I think there must have other better solution to handle this. Can anyone help on it? I bought the book, but did not find the solution for this particular problem.
    Thank you for the help.

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

    Default Re: Main page does not need sidebox... help!

    Use define_main_page.php for your home page (admin > Tools > Define Pages Editor).

    With tpl_main_page.php set to disable header and sideboxes on the home page (using $this_is_home_page), you can add all the HTML and PHP you want.

    Look at my site for an example - everything on the home page except for the left column is from define_main_page.php, absolutely positioned using CSS.

  7. #7
    Join Date
    May 2007
    Posts
    23
    Plugin Contributions
    0

    Default Re: Main page does not need sidebox... help!

    Thank you for the patience and help, Glenn, , this is the third help I got from you within a day. I really appreciate it.

    Now I know it can be done, but still I do not now how to do it ( I just began to learn PHP in this month):
    1. I went to define_main_page.php (admin > Tools > Define Pages Editor) but do not know what to do with this page.
    2. I do not know how to modify tpl_main_page.php to disable them (I did not use override system, just modify this file in template_default dir).

    Without bothering giving more detail guide, I am wondering if you could kindly sent me these two files of your website, then I could compare it with mine while looking at your website, I think I can figure it out in this way.

    Thanks,

    Regards,

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

    Default Re: Main page does not need sidebox... help!

    First and very important, you need to set up your own template directory, and put copies of all files you have modified into it in their proper order (matching /template_default). The only other file you absolutely need for your own template is /includes/templates/your_template/template_info.php (which you can copy from /template_default and change the info). See FAQ/Tutorials for full directions.

    There is nothing that would help you in my copy of tpl_main_page.php.
    All you need to do is add this snippet near the top of your copy (in your template folder! :)
    PHP Code:
    if ($this_is_home_page) {
       
    $flag_disable_header true;
       
    $flag_disable_left true;
       
    $flag_disable_right true;

    just below
    PHP Code:
     * @version $Idtpl_main_page.php 4886 2006-11-05 09:01:18Z drbyte $
     */ 
    I don't have time at the moment to zip define_main_page.php for uploading, but here is a representative sample at the beginning of the file:
    PHP Code:
    <?php $fr_root HTTP_SERVER DIR_WS_CATALOG
    $fr_cpath $fr_root 'index.php?main_page=index&cPath='?>
    <!--bof-home page header logo & links display-->
    <div id="homeShopView"><?php echo '<a href="' $fr_root 'index.php?main_page=page&id=2"><img src="' $fr_root DIR_WS_TEMPLATE 'images/frshopview.gif" alt="Our Shop"></a>';?></div>
    <div id="homeLogo"><?php echo '<img src="' $fr_root 'images/frlogohomepg.gif" alt="Future Relics - Timeless Creations in Precious Metals"></a>';?><br />
    We invite you ... etc...</div>
    (The PHP at the top was just for my convenience - you can use straight HTML, or PHP echo as shown:)
    PHP Code:
    <?php echo '<a href="' HTTP_SERVER DIR_WS_CATALOG 'index.php?main_page=page&id=2"><img src="' HTTP_SERVER DIR_WS_CATALOG DIR_WS_TEMPLATE 'images/frshopview.gif" alt="Our Shop"></a>';?>
    This points to my ezpage #2, and gets an image from the /my_template/images/ folder.
    Last edited by gjh42; 19 Jun 2007 at 11:32 PM.

  9. #9
    Join Date
    May 2007
    Posts
    23
    Plugin Contributions
    0

    Default Re: Main page does not need sidebox... help!

    Thank you for your kindly help! I will work on it.

    Best Regards,

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

    Default Re: Main page does not need sidebox... help!

    Here is a sample of the CSS I used to position the elements defined above:
    Code:
     * @version $Id: index_home.css  2007-05-18  gjh42 $
    
                       - this file contains CSS for the home page only
                       - it must be named index_home.css and live in /includes/templates/your_template/css/
     */
    
    
    #mainWrapper {
    	position:relative;
    	}
    #contentMainWrapper {
    	height: 1020px;
    	padding-top: 180px;
    	}
    
    #logoWrapper {display: none;} /*turns off sidebar logo on home page*/
    
    #homeLogo {
    	position:absolute;
    	top: 0px;
    	margin: auto;
    	font-size: 1.3em;
    	z-index: 100;
    	}
    #homeLogo img {margin: 5px;}
    h1 { margin-left: -21px; margin-bottom: -18px;}
    #homeShopView {
    	position: absolute;
    	top: 10px;
    	left: 3.5&#37;;
    	margin-left: -20px;
    	}
    #homeBoothView {
    	position: absolute;
    	top: 10px;
    	right: 3.5%;
    	margin-right: -20px;
    	}
    #headWed {
    	position: absolute;
    	top: 170px;
    	left: 31%;
    	padding-left: 21px;
    	font-size: 1.3em;
    	}
    	
    #headCel {
    	position: absolute;
    	top: 240px;
    	left: 42%;
    	padding-left: 21px;
    	font-size: 1.3em;
    	}
    	
    #headHis {
    	position: absolute;
    	top: 325px;
    	left: 48%;
    	padding-left: 21px;
    	font-size: 1.3em;
    	}
    	
    #headSpi {
    	position: absolute;
    	top: 420px;
    	left: 50%;
    	padding-left: 21px;
    	font-size: 1.3em;
    	}
    	
    #headEcl {
    	position: absolute;
    	top: 760px;
    	left: 50%;
    	padding-left: 21px;
    	font-size: 1.3em;
    	}
    	
    #headArt {
    	position: absolute;
    	top: 840px;
    	left: 46%;
    	padding-left: 21px;
    	font-size: 1.3em;
    	}
    	
    #headCoi {
    	position: absolute;
    	top: 920px;
    	left: 38%;
    	padding-left: 21px;
    	font-size: 1.3em;
    	}
    
    #homeImgRingP {
    	position: absolute;
    	top: 250px;
    	left: 27%;
    	}
    #homeImgGM {
    	position: absolute;
    	top: 310px;
    	left: 27.5%;
    	}
    Last edited by gjh42; 21 Jun 2007 at 01:19 PM.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Main Page does NOT update
    By Pablo in forum General Questions
    Replies: 5
    Last Post: 11 Jul 2011, 09:01 PM
  2. need help with main page & home page
    By shahram in forum General Questions
    Replies: 1
    Last Post: 20 Aug 2010, 01:27 AM
  3. Replies: 1
    Last Post: 17 Jul 2010, 02:50 AM
  4. Admin Page Works but Main Page Does Not
    By dbnorton in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 27 Jun 2006, 11:21 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