Directories??

Locked

Views: 1,992

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
8 Jul 2009, 12:17 PM
#1
jrheeder avatar

jrheeder

New Zenner

Join Date:
Jul 2009
Location:
Far Far Away
Posts:
20
Plugin Contributions:
0

Directories??

Hey there,

I have been looking around but I cannot see what the directory for the home page is. What I am trying to do is modify the home page using the instructions mentioned in tpl_main_page.php

/templates/MY_TEMPLATE/privacy/tpl_main_page.php

so I need the "privacy" replaced with the home page dir please.

Regards,
Johan

8 Jul 2009, 1:15 PM
#2
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Directories??

I'm not sure what you're trying to do. tpl_main_page.php
is located in includes/templates/template_default/common. Make your changes and save it to includes/templates/MY_TEMPLATE/common.

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey

8 Jul 2009, 1:21 PM
#3
jrheeder avatar

jrheeder

New Zenner

Join Date:
Jul 2009
Location:
Far Far Away
Posts:
20
Plugin Contributions:
0

Re: Directories??

afo:

I'm not sure what you're trying to do. tpl_main_page.php
is located in includes/templates/template_default/common. Make your changes and save it to includes/templates/MY_TEMPLATE/common.

The problem with that is that is changes he layout of all the pages. I just want to change the layout of the home page without affecting the other pages.

example: to override the privacy page
make a directory /templates/MY_TEMPLATE/privacy
copy /templates/templates_defaults/common/tpl_main_page.php to
/templates/MY_TEMPLATE/privacy/tpl_main_page.php

8 Jul 2009, 1:24 PM
#4
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: Directories??

Could it be you are looking to change a 'define' page?

includes/languages/english/html_includes/YOUR_TEMPLATE/define_main_page.php

The above file is the one to edit for changing some of what is shown on your Index / Home page of Zen Cart.

The learning is in the doing.

Potent Products

8 Jul 2009, 1:26 PM
#5
jrheeder avatar

jrheeder

New Zenner

Join Date:
Jul 2009
Location:
Far Far Away
Posts:
20
Plugin Contributions:
0

Re: Directories??

Website Rob:

Could it be you are looking to change a 'define' page?

includes/languages/english/html_includes/YOUR_TEMPLATE/define_main_page.php

The above file is the one to edit for changing some of what is shown on your Index / Home page of Zen Cart.

This only affect the content and not the layout of the page

8 Jul 2009, 1:45 PM
#6
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Directories??

jrheeder:

The problem with that is that is changes he layout of all the pages. I just want to change the layout of the home page without affecting the other pages.

example: to override the privacy page
make a directory /templates/MY_TEMPLATE/privacy
copy /templates/templates_defaults/common/tpl_main_page.php to
/templates/MY_TEMPLATE/privacy/tpl_main_page.php

I don't know where you got this notion from. There is no /privacy folder in Zen Cart. It won't know to look in there to find the tpl_main_page.php. What exactly are you trying to do?

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey

8 Jul 2009, 2:01 PM
#7
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Directories??

For those of us who were schooled in HTML for many years, moving to CM dynamic content sites produces a "huh???" effect for quite a while.

There are only a tiny handful of files in zc that can be condsidered "flat html" - and even then they are run as PHP files.

Pages in these systems "do not exist" until and unless they are called by the PHP code. This code "gathers up" a whole lot of elements, data, information and resources from many places - including other files and the database.

It then "cobbles together" a page (assembles it in real html) and then throws the result to the browser.

The minute a viewer navigates away from that page, it "evaporates".

Layout can be controlled in three areas:

  1. The structure of certain php files and the position of elements inside them
  2. The CSS stylesheets
  3. Switches and settings in the database.

If you are a lot more specific about what you want to alter, we may be able to point you in the right direction.

20 years a Zencart User

8 Jul 2009, 2:03 PM
#8
jrheeder avatar

jrheeder

New Zenner

Join Date:
Jul 2009
Location:
Far Far Away
Posts:
20
Plugin Contributions:
0

Re: Directories??

afo:

I don't know where you got this notion from. There is no /privacy folder in Zen Cart. It won't know to look in there to find the tpl_main_page.php. What exactly are you trying to do?

:blink: I thought I was clear in my asking :oops:.

Ok lets try this again. To edit a specific page's layout you would create a new folder using the page's name inside your template folder for my example I will use page About Us example

/includes/templates/MY_TEMPLATE/about_us

Now inside this folder you would place a copy of the tpl_main_page.php and then edit this to avoid messing up any other layout on any other pages. Thus making use of the "Override system"

/includes/templates/MY_TEMPLATE/about_us/tpl_main_page.php

Ok now I just want to know what the pagename of the home page is so I can edit the layout of the home page without messing us the rest of the pages, because the tpl_main_page.php in the common folder only defines the site-wide "default" layout of your site template

Does this make it a bit more clear?:unsure:

Regards,
Johan

P.S.

If you look in the tpl_main_page.php right at the top it has this

<?php
/**
 * Common Template - tpl_main_page.php
 *
 * Governs the overall layout of an entire page<br />
 * Normally consisting of a header, left side column. center column. right side column and footer<br />
 * For customizing, this file can be copied to /templates/your_template_dir/pagename<br />
 * example: to override the privacy page<br />
 * - make a directory /templates/my_template/privacy<br />
 * - copy /templates/templates_defaults/common/tpl_main_page.php to /templates/my_template/privacy/tpl_main_page.php<br />
 * <br />
...
8 Jul 2009, 2:44 PM
#9
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: Directories??

Ok now I just want to know what the pagename of the home page

includes/templates/YOUR_TEMPLATE/common/tpl_main_page.php

It is a different story if you are trying to edit / create:

includes/templates/YOUR_TEMPLATE/privacy/tpl_main_page.php

So the question is; "Which page are you wanting to work with?"

The learning is in the doing.

Potent Products

8 Jul 2009, 2:46 PM
#10
jrheeder avatar

jrheeder

New Zenner

Join Date:
Jul 2009
Location:
Far Far Away
Posts:
20
Plugin Contributions:
0

Re: Directories??

The home page of the site the first page you see when you log into the site.

So all I want is to know what the pagename of the home page is, the first page you see when you log onto the site

8 Jul 2009, 2:52 PM
#11
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: Directories??

Then you are wanting to work with:

includes/languages/english/html_includes/YOUR_TEMPLATE/define_main_page.php

for adding Content to the main page.

Other options are display specific to the Home page by configuring:

includes/templates/YOUR_TEMPLATE/common/tpl_main_page.php

For example:

To turn off the left column for the home page only, you would insert the following:
if ($this_is_home_page) {
$flag_disable_left = true;
}

To turn off the left and right columns for the home page only, you would insert the following:
if ($this_is_home_page) {
$flag_disable_left = true;
$flag_disable_right = true;
}

The learning is in the doing.

Potent Products

8 Jul 2009, 3:05 PM
#12
gjh42 avatar

gjh42

Black Belt

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

Re: Directories??

Try /includes/templates/your_template/index/tpl_main_page.php .

Unfortunately, this will apply to all index pages including category listing and product listing.
For editing home page layout, you will need to add/modify code in the main tpl_main_page.php, with tests for

if ($this_is_home_page){
  //do home page stuff
}else{
  //do default stuff
}

The CSS can be customized for the home page by adding a file named index_home.css; but adding an /index_home/ folder will have no effect.

8 Jul 2009, 3:09 PM
#13
jrheeder avatar

jrheeder

New Zenner

Join Date:
Jul 2009
Location:
Far Far Away
Posts:
20
Plugin Contributions:
0

Re: Directories??

Website Rob:

Then you are wanting to work with:

includes/languages/english/html_includes/YOUR_TEMPLATE/define_main_page.php

for adding Content to the main page.

Other options are display specific to the Home page by configuring:

includes/templates/YOUR_TEMPLATE/common/tpl_main_page.php

For example:

I dont want to add content as much as change the layout for the home page. I have the layout working I just need the pagename of the home page.

8 Jul 2009, 3:11 PM
#14
jrheeder avatar

jrheeder

New Zenner

Join Date:
Jul 2009
Location:
Far Far Away
Posts:
20
Plugin Contributions:
0

Re: Directories??

gjh42:

Try /includes/templates/your_template/index/tpl_main_page.php .

Unfortunately, this will apply to all index pages including category listing and product listing.
For editing home page layout, you will need to add/modify code in the main tpl_main_page.php, with tests for

if ($this_is_home_page){
//do home page stuff
}else{
//do default stuff
}

> 
> The CSS can be customized for the home page by adding a file named index_home.css; but adding an /index_home/ folder will have no effect.

:clap: BRILLIANT! this is exaclty what I required thank you:bigups:

Regards,
Johan

P.S Was I very unclear in what I required or was it just out of the norm what I was asking for?
8 Jul 2009, 3:13 PM
#15
gjh42 avatar

gjh42

Black Belt

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

Re: Directories??

I think it was just out of the norm.

But a radically different layout for the home page is common enough that I really think there should be a mechanism for using an /index_home/ folder. This may be addressed in a totally different manner with the restructuring in v2.0.