Zen Cart Logo

different main page

Locked

Views: 5,312

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
28 Jun 2007, 10:47 PM
#1
maczooma avatar

maczooma

New Zenner

Join Date:
Jun 2007
Posts:
3
Plugin Contributions:
0

different main page

Hello I'm working with one of these dreaded Template monster templates, however so far things are going okay, I think.

However I want to use a large image on my home page, then have it disappear for all of the others.

What code do I have to add?

My site is http://www.ningunpecado.com/catalog

Thanks

29 Jun 2007, 12:32 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: different main page

What ever you do will probably not work with their template - -

But you can attempt to use the admin > tools > defines page editor > main_page.php > and insert the image there

If the template uses the main_page.php function there you have it

If not you will need to get with them

29 Jun 2007, 8:12 PM
#3
maczooma avatar

maczooma

New Zenner

Join Date:
Jun 2007
Posts:
3
Plugin Contributions:
0

Re: different main page

I thought that there was a main page only bit of code that I could put in?

29 Jun 2007, 8:26 PM
#4
vwebworld avatar

vwebworld

New Zenner

Join Date:
Mar 2005
Location:
South coast of MA, USA
Posts:
72
Plugin Contributions:
0

Re: different main page

One way to do that without messing up anything is to create a "default.php" page by saving the index.php page as default.php.

Then change what you want on the default.php page... make that the landing page by changing your htaccess file list to default.php index.php index.html

That way the default page will appear first, but everything will work - you product pages, search results...etc since they use the index.php page.
You should add a link to the default page too.

29 Jun 2007, 9:32 PM
#5
maczooma avatar

maczooma

New Zenner

Join Date:
Jun 2007
Posts:
3
Plugin Contributions:
0

Re: different main page

Sorry but what and where is my htaccess file list?

30 Jun 2007, 9:24 PM
#6
vwebworld avatar

vwebworld

New Zenner

Join Date:
Mar 2005
Location:
South coast of MA, USA
Posts:
72
Plugin Contributions:
0

Re: different main page

To change yourd default directory page:
http://www.javascriptkit.com/howto/htaccess6.shtml

Your htaccess file is in the root diectory

9 Jul 2007, 8:28 AM
#7
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: different main page

Zen Cart has a variable called $this_is_home_page that can be used to differentiate the contents of the home page from all others. For example> if ($this_is_home_page) {

your special code in here

} else {
normal code for all other pages in here

}
However, because of the way that Template Monster completely re-write much of the template code, there is a high risk that this will not work for you.

18 Sep 2007, 8:30 AM
#8
maza avatar

maza

New Zenner

Join Date:
Apr 2007
Posts:
98
Plugin Contributions:
0

Re: different main page

Now I'm having problem to understand about adding image on the main page. OK I got the "add the image inside your define_main_page.php" part, but how to link the image?

Example, my image "title2.jpg" is inside my /include/templates/MY_TEMPLATE/images/ subfloder. How can I put the code inside "define_main_page.php" to link my image from this subfolder?

Please somebody help.

18 Sep 2007, 10:33 AM
#9
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: different main page

In the define page editor you can enter normal html code for this - just create you anchor statement sorts like:

<a href="Your_reference"><img src="images/your_image.gif" alt="alt_text" width="80" height="80" /></a>
16 Feb 2008, 5:47 AM
#10
henrietta avatar

henrietta

New Zenner

Join Date:
Mar 2007
Location:
WAY out West
Posts:
86
Plugin Contributions:
0

Re: different main page

Very helpful Kobra, thank you.:hug:

18 Feb 2008, 2:44 PM
#11
covone avatar

covone

Zen Follower

Join Date:
Oct 2004
Posts:
409
Plugin Contributions:
0

Re: different main page

I use the below code to only show image on homepage. This might be a helpful to others. I'm also using latest zen 1.3.8a. Put the code in your tpl_header.php which is found in the common folder. Make sure to put it in the overrides. you can view my web site link below. I beleive this is what you looking for?

<!-- bof top image --> <?php if ($this_is_home_page) { ?> <div align="center"> <center> <table border="0" cellspacing="0" width="800" cellpadding="0"> <tr> <td> <img border="0" src="http://your domain/images/your_image.jpg" alt="Athying goes here"> </td> </tr> </table> </center> </div> <?php } ?> <!-- eof top image -->
18 Feb 2008, 2:49 PM
#12
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: different main page

covone:

I use the below code to only show image on homepage.While the use of the $this_is_home_page is absolutely correct, I'd strongly recommend against introducing tables, the center attribute and the deprecated <center> tag into the header template. There are much better and controllable ways of placing a centered image in your header.

18 Feb 2008, 3:14 PM
#13
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: different main page

And before I forget, remember that you can also change the appearance of your home page by creating a index_home.css stylesheet.