Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2008
    Posts
    47
    Plugin Contributions
    0

    Default Change URL of my Home Buttons to root of the domain when my site is in a sub folder

    Can a Sub Folder Installation have home button which point to the root of the domain?

    I have installed my zen cart to www.kitchenandbedroominteriors.com/store

    I want all of the 'Home Buttons' to link back to www.kitchenandbedroominteriors.com

    I have had a good look through the forums and can not find any threads in relation to this.

    Any help will be much appretiated

    Many Thanks

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Change URL of my Home Buttons to root of the domain when my site is in a sub fold

    The home location is determined by php code.

    For example: In your tpl_header.php file, you will see:

    PHP Code:
        <li><?php echo '<a href="' HTTP_SERVER DIR_WS_CATALOG '">'?><?php echo HEADER_TITLE_CATALOG?></a></li>
    You'll need to remove (or comment out) that and create a hard-coded link to your desired home page.
    20 years a Zencart User

  3. #3
    Join Date
    Apr 2008
    Posts
    47
    Plugin Contributions
    0

    Default Re: Change URL of my Home Buttons to root of the domain when my site is in a sub fold

    Hi,

    Which files would need to be hard coded?

    Many Thanks

    Col




    Quote Originally Posted by schoolboy View Post
    The home location is determined by php code.

    For example: In your tpl_header.php file, you will see:

    PHP Code:
        <li><?php echo '<a href="' HTTP_SERVER DIR_WS_CATALOG '">'?><?php echo HEADER_TITLE_CATALOG?></a></li>
    You'll need to remove (or comment out) that and create a hard-coded link to your desired home page.

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Change URL of my Home Buttons to root of the domain when my site is in a sub fold

    Quote Originally Posted by colnixon
    Which files would need to be hard coded?
    schoolboy gave you the file
    Quote Originally Posted by schoolboy
    For example: In your tpl_header.php file, you will see:
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Change URL of my Home Buttons to root of the domain when my site is in a sub fold

    Looks like you are using a derivation of Apple-zen template.

    There are TWO main links in core zencart back to the "home" page (which is the front page of the webshop).

    You will need to edit

    includes/templates/apple_zen/common/tpl_header.php

    and

    includes/templates/apple_zen/common/tpl_footer.php

    <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>

    becomes:

    <li><a href="http://www.kitchenandbedroominteriors.com">Main Site</a></li>

    Rather than DELETE the original code, use comment tags to render it ineffective:

    <!--<li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>-->

    additionally, in apple_zen, there is another file:

    includes/templates/apple_zen/common/tpl_drop_menu.php

    ... in which there is also a "home" link. Now in my opinion, you should leave this one in, but perhaps change the DEFINE for HEADER_TITLE_CATALOG:

    /includes/languages/english/apple_zen/header.php

    define('HEADER_TITLE_CATALOG', 'Home');

    to something like:

    define('HEADER_TITLE_CATALOG', 'Shop Home Page');

    However, if you want this to ALSO point to the root site, then comment out the following line using HTML comment tags (shown in green)

    <!-- <li class="submenu"><a href="<?php echo zen_href_link(FILENAME_DEFAULT); ?>"><?php echo HEADER_TITLE_CATALOG; ?></a> -->

    and put in your own hardcode link directly under it... eg:

    <li class="submenu"><a href="http://www.kitchenandbedroominteriors.com">Main Site</a>


    The HEADER_TITLE_CATALOG define is also used in places like the breadcrumbs, and you really don't want to fool about with those. That is why I suggest that whatever hard coding you do to other links, use Main Site as the text link, and by changing the define for HEADER_TITLE_CATALOG to Shop Home Page, at least your visitors will know what to click to either go back to your root site, or stay within the shop area.
    20 years a Zencart User

  6. #6
    Join Date
    Apr 2008
    Posts
    47
    Plugin Contributions
    0

    Default Re: Change URL of my Home Buttons to root of the domain when my site is in a sub fold

    Hi Schoolboy

    Thanks a million for the in depth advice, my php aint great and the extra help is much appretiated

    Thanks Again

    Regards

    Col

 

 

Similar Threads

  1. v154 Change existing site from sub directory to the root of the web site
    By fjbern1943 in forum Installing on a Linux/Unix Server
    Replies: 21
    Last Post: 25 Jun 2015, 03:16 AM
  2. Moving a store to the root directory from a sub-folder
    By Hell Guapo in forum General Questions
    Replies: 3
    Last Post: 21 Sep 2011, 05:51 PM
  3. Moving Site from Sub-folder to Root
    By willchen88 in forum Installing on a Linux/Unix Server
    Replies: 10
    Last Post: 7 Aug 2011, 06:47 AM
  4. Replies: 3
    Last Post: 13 Dec 2010, 05:28 PM
  5. Problem moving folder from sub-root to root
    By andycowboy in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 28 Jul 2009, 02:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg