If this is your first visit, check our documentation. To post, register or login.
Forums / Templates, Stylesheets, Page Layout / Trying to change the layout of my Zencart

Trying to change the layout of my Zencart

Locked

Started by amcdougall on 19 Jul 2007, 5:06 PM · Views: 1,239

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
19 Jul 2007, 5:06 PM
#1
amcdougall avatar

amcdougall

New Zenner

Join Date:
Jul 2007
Posts:
6
Plugin Contributions:
0

Trying to change the layout of my Zencart

I'm trying to add in a new header, footer and body with HTML and GIFs that I have. My problem is that I've followed every instruction on template override and creation and I still can't figure out how to get my layout for the main page to display. Can someone tell me what files I would need to change in order to add my either HTML code for the header or a bunch of gif images that make up the header? I've created a folder under templates called Store and added the folders that are required and have added in the files; html_header.php and I'm not sure how to get my HTML code to act as the new header. Is there something that I have to change, like maybe a filename in this to point to somewhere that this new HTML I created will exist? If so, what do I name the file since it is strictly html? Anyway any help would be greatly appreciated. I bought the book but it really just describes the template setup and change within the admin console and not from a coding perspective.

19 Jul 2007, 5:57 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Trying to change the layout of my Zencart

You can't just replace those stock files with your static HTML files, because they call in other files/functions as required for complete functioning.

What you can do is (say for the header) make an override copy of tpl_header.php, comment out functions you don't want it to do, and insert the HTML code (not complete HTML page files) with display of the gifs you want.

For the home page, you can (in tpl_main_page.php) disable header, footer and sideboxes, either by if tests or hardcoded in an override copy of the file, and put the entire display/function code you want in define_main_page.php. This can be edited directly or through the Define Pages Editor in admin > Tools.

Look at my site home page for an example of this approach - everything but part of the left sidebar and footer is from define_main_page.php.

PS - have you done all the steps to create and activate a custom template? You don't have to have all your custom files in place to activate the template.

19 Jul 2007, 6:24 PM
#3
amcdougall avatar

amcdougall

New Zenner

Join Date:
Jul 2007
Posts:
6
Plugin Contributions:
0

Re: Trying to change the layout of my Zencart

I've lost my main page now and I'm not sure how to get it back. It appears that I've accidentally messed with the wrong file in trying to get this working. Anyway I created a directory under the includes called Store and put the html_header.php and tpl_header.php there and it seems that my original html_header.php got changed. Anyway it doesn't appear to see the html_header.php in the Store directory as an override. This setup seems to be more complex then I expected and with very little documentation on what each file does exactly.
Anyway any idea on how to get back to where I was before it stopped displaying the main page? As well what functions you need in the tpl_header.php to get my own header in there?

19 Jul 2007, 6:57 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Trying to change the layout of my Zencart

Don't despair ;)

A link to your site will make it easier to advise you.
Do you have /includes/templates/Store/common/tpl_header.php? It must be exactly that folder structure to work - follow the pattern of /template_default/.

What you show is just a gif, which can be dropped in for your logo. What HTML do you want that can't be accomplished by the standard tpl_header functionality?

19 Jul 2007, 7:21 PM
#5
amcdougall avatar

amcdougall

New Zenner

Join Date:
Jul 2007
Posts:
6
Plugin Contributions:
0

Re: Trying to change the layout of my Zencart

Okay ... unfortunately I don't have a web link just yet. Anyway here is my html file of the entire main page, which I've divided up into a header and footer piece. I've sent the gif images along as well.

Also I have that folder structure but it doesn't seem to be working. I've uploaded the files I mentioned but I can't get all the images associated with them uploaded. Anyway the files that are txt files are actually html files.Anyway it is these files that I'm trying to get as my header and footer. I'll see if I can do a screen capture and upload that so you can see what it looks like.

19 Jul 2007, 7:49 PM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Trying to change the layout of my Zencart

So you have a bunch of humungous tables to output sliced & diced images... but I don't see any functions in all that. A screenshot of your intended results will be more useful, as well as a description of what you are trying to accomplish with these tables.
Unless there is something unique about your application, it looks like you are trying to apply stone age technology to a spaceship. Tables to lay out a whole site are obsolete - divs and CSS styling do the job better, more flexibly and with less code.
The files you show are each for a whole HTML page; if you add code, it should be only the functional code, as the cart takes care of opening and closing the page.

Did you follow the template creation instructions and activate your custom template? Until you do that, Zen Cart will ignore those files.

19 Jul 2007, 8:18 PM
#7
amcdougall avatar

amcdougall

New Zenner

Join Date:
Jul 2007
Posts:
6
Plugin Contributions:
0

Re: Trying to change the layout of my Zencart

I agree with you about the tables and such. These html was done by a graphics person and the people that want this website want me to make this as their home page. Anyway the screen prints should give you a better idea of what I'm trying to do with what I've sent you. Unfortunately my expeirence with php and css is relatively new as I'm a java guy.Anyway I'm trying to figure out how to best do this such that it works correctly but unfortunately the book I got from their website shows very little in the way of how to work with the code. Anyway I did change the template over to the new folder created but I think that I've messed with so many files trying to figure this out that I've messed something up. Anyway if you could give me a pointer on what code I need to look at to make this happen and maybe an example that would be great!

19 Jul 2007, 8:52 PM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Trying to change the layout of my Zencart

If the customer thinks they want this, I suppose you have to give it to them...

I don't know what the files in the zip are supposed to do - the .docs don't make any sense to me.
What would be useful is to post (attach) jpeg screenshots that don't require downloading and unzipping and running in some unspecified program.

At any rate, the HTML you posted doesn't do anything but display images - what functions is the page supposed to do? Are the functions supposed to be integrated with the images?

To get your home page free of header etc. you can follow instructions given in the comments at the top of tpl_main_page.php, and put all your code into define_main_page.php.

The book is written and promoted as an owner's manual to install, set up and run a site. Serious customizing would require several more books that size to cover fully.

19 Jul 2007, 8:59 PM
#9
amcdougall avatar

amcdougall

New Zenner

Join Date:
Jul 2007
Posts:
6
Plugin Contributions:
0

Re: Trying to change the layout of my Zencart

The zip file is just 3 word docs that I did of the webpage. As for this page having dynamic content, yes. If you can open the zip files word docs you'll see the images and in the Body one you'll see 3 circles each of which will link to a new page once I figure out how to make this work. I also need to put images of products in the body of the webpage as well. Anyway I guess I just don't see how this all fits together yet or know enough php.

19 Jul 2007, 9:28 PM
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Trying to change the layout of my Zencart

Tried to open the .docs and get "unable to open graphics conversion filter"...

Look at tpl_main_page.php for starters.

Here is a bit of my define_main_page.php for a teaser (this outputs the logo with subtext, and images on each side of it, which are links to about us and calendar pages):```php

<?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 to explore our catalog, ...</div> <div id="homeBoothView"><?php echo '<a href="' . $fr_root . 'index.php?main_page=page&id=3"><img src="' . $fr_root . DIR_WS_TEMPLATE . 'images/frboothview.gif" alt="Our Shop"></a>';?></div> <!--eof-home page header logo & links display--> ```