Zen Cart Logo
Forums / General Questions / New link in Header not working

New link in Header not working

Views: 658

Results 1 to 8 of 8
13 Apr 2011, 6:31 PM
#1
samuelstone avatar

samuelstone

New Zenner

Join Date:
Apr 2011
Posts:
4
Plugin Contributions:
0

New link in Header not working

Hello all

I have created a new link in my header to a gallery page I am trying to build. I have successfully created the link (Gallery) in my header but every time I click it it jumps to Page not Found. Can anyone help?

website is: https://www.x-rayfog.com

I am using the latest Zen Cart.

13 Apr 2011, 7:07 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: New link in Header not working

The link points to /index.php?main_page=FILENAME_GALLERY, which indicates that FILENAME_GALLERY is not defined. Have you defined it? Where? Post the section of menu code you are working with, between ```
[php] and [/php]

14 Apr 2011, 12:59 PM
#3
samuelstone avatar

samuelstone

New Zenner

Join Date:
Apr 2011
Posts:
4
Plugin Contributions:
0

Re: New link in Header not working

Thanks for your quick response.
I have defined the page in includes/extra_datafiles/gallery.php. I have followed a couple of different methods for creating this link (http://breathing-spring.com/creating-new-pages-for-zen-cart/) and none seem to work so I must be doing something wrong.

If you look at https://www.xrayfog.com now, the extra_datafiles code appears above the header. I'm a little perplexed.

As for the menu code, forgive my ignorance but do you mean the code for the header of the mainpage (includes/templates/template_default/common/tpl_header)? If so it is:

<!--bof-header logo and navigation display--> <?php if (!isset($flag_disable_header) || !$flag_disable_header) { ?> <div id="headerWrapper"> <!--bof-navigation display--> <div id="navMainWrapper"> <div id="navMain"> <ul class="back"> <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li> <?php if (DEFINE_GALLERY_STATUS <= 1) { ?> <li><?php echo '<a href="' . zen_href_link(FILENAME_GALLERY, '', 'SSL') . '">' . Gallery . '</a>'; ?></li> <?php } ?> <?php if (DEFINE_CONTACT_US_STATUS <= 1) { ?> <li><?php echo '<a href="' . zen_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>'; ?></li> <?php } ?> <?php if ($_SESSION['customer_id']) { ?> <li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li> <li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li> <?php } else { if (STORE_STATUS == '0') { ?> <li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li> <?php } } ?> <?php if ($_SESSION['cart']->count_contents() != 0) { ?> <li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li> <li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li> <?php }?> </ul> </div> <div id="navMainSearch"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div> <br class="clearBoth" /> </div> <!--eof-navigation display-->
14 Apr 2011, 1:30 PM
#4
usr50 avatar

usr50

Zen Follower

Join Date:
Mar 2009
Location:
Niagara Ontario
Posts:
136
Plugin Contributions:
0

Re: New link in Header not working

Did you get this sorted? the link worked for me other a line of code appearing http://www.x-rayfog.com/zencatalogue/

14 Apr 2011, 1:45 PM
#5
samuelstone avatar

samuelstone

New Zenner

Join Date:
Apr 2011
Posts:
4
Plugin Contributions:
0

Re: New link in Header not working

No, not sorted yet. I don't quite understand your message. Do you mean the link works for you?. Where does it take you?

14 Apr 2011, 4:08 PM
#6
gjh42 avatar

gjh42

Black Belt

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

Re: New link in Header not working

Your define code is being output as HTML content, not read as PHP.

<?php define(FILENAME_GALLERY, 'gallery'); ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
19 Apr 2011, 12:16 PM
#7
samuelstone avatar

samuelstone

New Zenner

Join Date:
Apr 2011
Posts:
4
Plugin Contributions:
0

Re: New link in Header not working

Can you tell me how I would rectify this?

Many thanks

S

19 Apr 2011, 3:19 PM
#8
gjh42 avatar

gjh42

Black Belt

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

Re: New link in Header not working

What kind of file is the code in? How did you create the file (what editor did you use)? What is the complete content of that file as it exists on your server?