Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / problem with index page??

problem with index page??

Views: 970

Results 1 to 14 of 14
14 May 2011, 8:40 AM
#1
ssuunnyy18 avatar

ssuunnyy18

New Zenner

Join Date:
May 2011
Posts:
10
Plugin Contributions:
0

problem with index page??

Hi i am new to zencart and i am having trouble to find the code of tpl_main_page.php and tp_header.php of my index page

all other pages else index page are linked in my theme common folder that contains tpl_main_page.php and tpl_header.php

I am struggling so much to find the code of that thingh?? please help....

14 May 2011, 12:00 PM
#2
coolcarpartsonline avatar

coolcarpartsonline

Totally Zenned

Join Date:
Feb 2008
Posts:
1,386
Plugin Contributions:
0

Re: problem with index page??

If you are new to zen cart, you SHOULD NOT touch the tpl_main_page as it controls the whole website not only the index page. Any edits to the tpl_html_header should only be performed if you are certain of what you are doing and already have backup.

There is no such thing as tpl_main_page for the home page. Home page has it's own template file tpl_index_default.

14 May 2011, 1:37 PM
#3
ssuunnyy18 avatar

ssuunnyy18

New Zenner

Join Date:
May 2011
Posts:
10
Plugin Contributions:
0

Re: problem with index page??

hello sir you are right but i have a good knowledge of php so it doesn't matter so much
all i want to know is wuhy the index page is different from all other page and why its not taking tpl_header.php and tpl_main_page.php from my theme i selected that is not template_default
i select custom theme
now all i want to know is from where my index page is selecting header and main page code
if you have any idea about that plaease help sir

14 May 2011, 1:45 PM
#4
gjh42 avatar

gjh42

Black Belt

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

Re: problem with index page??

We would need to see your site to know what your setup is.
Let's continue the discussion in this thread only, and not in the other thread where you posted the identical question.

14 May 2011, 2:41 PM
#5
ssuunnyy18 avatar

ssuunnyy18

New Zenner

Join Date:
May 2011
Posts:
10
Plugin Contributions:
0

Re: problem with index page??

actually i am new forum so i mistakely post it at that place and i dont know how to delete it now...........

ok the site is http://w w w.p o o l s p l u s p a t i o.c o m/index.php?main_page=shop and i put spaces here beacause i dont want to list it on search engine please remove spaces to check it this is the link of other page

http://w w w.p o o l s p l u s p a t i o.c o m/index.php?main_page=index this is the link of home page and now for check see the rss and facebook and twitter link

when i change tpl_header.php in my custom template its effect on all the page other than home page and you can see the difference by clicking on facebook and twitter link

i want to know why index page is not accepting the changes i made in my custom template tpl_header.php and from where its actually taking its code.

14 May 2011, 3:11 PM
#6
gjh42 avatar

gjh42

Black Belt

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

Re: problem with index page??

Not sure what is happening yet, but I do notice that your home page has no HTML <body> element in its view source:```html
</script>

</head> <div class="header_pad"><div class="header_pad_left"> <div style="margin:0 auto;padding-left:775px;"> <!--// bof: currencies //--> ``` The Online Shop page is okay: ```html </script> </head> <body id="shopBody"> <div class="header_pad"><div class="header_pad_left"> <div style="margin:0 auto;padding-left:775px;"> <!--// bof: currencies //--> ```as is a category page:```html </script> </head> <body id="indexBody"> <div class="header_pad"><div class="header_pad_left"> <div style="margin:0 auto;padding-left:775px;"> <!--// bof: currencies //--> ``` You should have <body id="indexHomeBody"> in the home page source.
14 May 2011, 3:19 PM
#7
gjh42 avatar

gjh42

Black Belt

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

Re: problem with index page??

What do you have in your template copy of tpl_main_page.php around the <body id=" line?

14 May 2011, 3:46 PM
#8
ssuunnyy18 avatar

ssuunnyy18

New Zenner

Join Date:
May 2011
Posts:
10
Plugin Contributions:
0

Re: problem with index page??

sir i have this code in my tpl_main_page.php

<body id="<?php echo $body_id . 'Body'; ?>"<?php if($zv_onload !='') echo ' onload="'.$zv_onload.'"'; ?>>
14 May 2011, 3:46 PM
#9
gjh42 avatar

gjh42

Black Belt

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

Re: problem with index page??

For reference, the stock version of tpl_main_page.php has```php
$body_id = ($this_is_home_page) ? 'indexHome' : str_replace('_', '', $_GET['main_page']);
?>

<body id="<?php echo $body_id . 'Body'; ?>"<?php if($zv_onload !='') echo ' onload="'.$zv_onload.'"'; ?>> ```

What does your
$body_id =
line look like?

14 May 2011, 3:50 PM
#10
ssuunnyy18 avatar

ssuunnyy18

New Zenner

Join Date:
May 2011
Posts:
10
Plugin Contributions:
0

Re: problem with index page??

sir i have this code above body tag in my tpl_main_page.php

if($this_is_home_page)
{
include DIR_WS_TEMPLATE."common/splash.php";
exit();
}

// the following IF statement can be duplicated/modified as needed to set additional flags
if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces')) ) {
$flag_disable_right = true;
}

$header_template = 'tpl_header.php';
$footer_template = 'tpl_footer.php';
$left_column_file = 'column_left.php';
$right_column_file = 'column_right.php';
$single_column_file = 'column_single.php';
$body_id = ($this_is_home_page) ? 'indexHome' : str_replace('_', '', $_GET['main_page']);
?>

is this code creating the problem???

14 May 2011, 3:52 PM
#11
gjh42 avatar

gjh42

Black Belt

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

Re: problem with index page??

It occurs to me that if somehow the <body id=" line were not being output, the $zv_onload parameters would not be output either, and that might affect something like javascripts that make fb/twitter links.

14 May 2011, 3:53 PM
#12
gjh42 avatar

gjh42

Black Belt

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

Re: problem with index page??

This must be the culprit:

if($this_is_home_page)
{
include DIR_WS_TEMPLATE."common/splash.php";
exit();
}

splash.php is totally replacing the processing of tpl_main_page.php. What does that file look like?

14 May 2011, 4:16 PM
#13
ssuunnyy18 avatar

ssuunnyy18

New Zenner

Join Date:
May 2011
Posts:
10
Plugin Contributions:
0

Re: problem with index page??

i made a change in splash.php and its work like charm now
thank you so much for the support sir :clap:

14 May 2011, 5:14 PM
#14
coolcarpartsonline avatar

coolcarpartsonline

Totally Zenned

Join Date:
Feb 2008
Posts:
1,386
Plugin Contributions:
0

Re: problem with index page??

Since you shared your site, If I may suggest using solid background for site content as the waves may seem relevant to you but site suffer from readability.