Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Sep 2009
    Posts
    23
    Plugin Contributions
    0

    Default Include in Index

    I'm just trying to add an include statement to the bottom of the main index file in zencart. It doesn't work. When I paste the contents of the included file in the index, it works fine. Any thoughts?

    Thanks,

    Peter

  2. #2
    Join Date
    Nov 2007
    Location
    Melbourne, Australia
    Posts
    541
    Plugin Contributions
    0

    Default Re: Include in Index

    Have you tried require instead of include?

    For example, the header is included with this statement
    Code:
    require($template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header.php');?>

  3. #3
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: Include in Index

    I'm just trying to add an include statement to the bottom of the main index file in zencart. It doesn't work. When I paste the contents of the included file in the index, it works fine. Any thoughts?
    It can depend on exactly what you are trying to include ... more details?
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  4. #4
    Join Date
    Sep 2009
    Posts
    23
    Plugin Contributions
    0

    Default Re: Include in Index

    Quote Originally Posted by tino.schlegel View Post
    Have you tried require instead of include?

    For example, the header is included with this statement
    Code:
    require($template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header.php');?>
    Yes, require doesn't work either.

  5. #5
    Join Date
    Sep 2009
    Posts
    23
    Plugin Contributions
    0

    Default Re: Include in Index

    Quote Originally Posted by Kim View Post
    It can depend on exactly what you are trying to include ... more details?
    It is just some navigation, in the form of image links.

  6. #6
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: Include in Index

    ... and the syntax you are using and the exact position on the page?
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  7. #7
    Join Date
    Sep 2009
    Posts
    23
    Plugin Contributions
    0

    Default Re: Include in Index

    Quote Originally Posted by Kim View Post
    ... and the syntax you are using and the exact position on the page?
    include("/pages/bottom.htm");


    placed on the index.php file at the bottom right before
    <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

    this is the same place i placed the html code and that worked

  8. #8
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: Include in Index

    Try putting it in the template file instead of the php file.
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  9. #9
    Join Date
    Sep 2009
    Posts
    23
    Plugin Contributions
    0

    Default Re: Include in Index

    Quote Originally Posted by Kim View Post
    Try putting it in the template file instead of the php file.
    I am new to zencart, can you tell me where that is?

  10. #10
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: Include in Index

    May I suggest you start with the tutorial/FAQs on how to customize Zen Cart before you do anything further? Pay particular attention to the section on how to create your template overrides.

    https://www.zen-cart.com/tutorials/index.php
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. include('zencart/index.php')
    By binarycat in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 13 Apr 2010, 05:03 AM
  2. Category Images displayed in link /index.php?=index&cPath=0
    By shadowd in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 5 Feb 2010, 09:16 PM
  3. How do I include the title in the address bar to include the product name?
    By alliedlock in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 2 Aug 2009, 05:59 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