Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2009
    Posts
    60
    Plugin Contributions
    0

    Idea or Suggestion Linking custom content to define pages

    I am in the beginning phases of installing a custom responsive_classic cart 1.5.5e version. www.uesakausa.com

    Is it possible to use includes on the define_main_page.php?

    If so would I save them in my include/languages/english/html_includes/my_temp/ directory? And then, how do I call them in the define_main_page.php <?php include('some.php) ?>

    Thanks in advance for any input!
    Last edited by MaxBodine; 8 Jan 2018 at 04:42 PM.

  2. #2
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: How can I be using include() on define_main_page.php

    Quote Originally Posted by MaxBodine View Post
    I am in the beginning phases of installing a custom responsive_classic cart 1.5.5e version. www.uesakausa.com

    Is it possible to use includes on the define_main_page.php?

    If so would I save them in my include/languages/english/html_includes/my_temp/ directory? And then, how do I call them in the define_main_page.php <?php include('some.php) ?>

    Thanks in advance for any input!
    What are you trying to include or could you give an example of what an 'include' is?

    define_main_page.php can be a static html page or you can mark it up with php - very useful and flexible either way.
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  3. #3
    Join Date
    Apr 2009
    Posts
    60
    Plugin Contributions
    0

    Default Re: How can I be using include() on define_main_page.php

    Instead of writing the home page as one long page on define_main_page.php, for maintenance and a lot of updating that I do, I wanted to organize sections in php includes.

    Example my regular websites index.php pages, I would take the six image section on https://uesakausa.com put that in its own php file then on the index page I would use one line a php include() function.

    <?php include('sixPictureSection.php') ?>

    Then I can swap those out easily.

    In the zen cart I would need to know what directory to save the sixPictureSection.php in so the define_main_page.php would know where to find it. I am just assuming I can do that.

    Thanks!

  4. #4
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: How can I be using include() on define_main_page.php

    Quote Originally Posted by MaxBodine View Post
    Instead of writing the home page as one long page on define_main_page.php, for maintenance and a lot of updating that I do, I wanted to organize sections in php includes.

    Example my regular websites index.php pages, I would take the six image section on https://uesakausa.com put that in its own php file then on the index page I would use one line a php include() function.

    <?php include('sixPictureSection.php') ?>

    Then I can swap those out easily.

    In the zen cart I would need to know what directory to save the sixPictureSection.php in so the define_main_page.php would know where to find it. I am just assuming I can do that.

    Thanks!
    /languages is where you want to define the text for multi language support... or to follow suite with the rest of the coding structure.

    /modules
    is where the meat and potatoes or work functions should go.

    /templates for the visual structure bits.

    Add them into a template folder regardless of where you put them to keep it clean OR add them to a like named file inside one of the 'extra' folders.

    Like: includes/languages/english/extra_definitions

    These will be accessible through the code and most if not all of the defines will automatically load within the page range you are calling.


    Be sure to use the 'already thought out' zen - lookup codes to call the appropriate directory so... if anything changes or moves the directory paths move with the change. Static links might work but long term they become speed bumps ;)
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,498
    Plugin Contributions
    88

    Default Re: How can I be using include() on define_main_page.php

    Quote Originally Posted by MaxBodine View Post
    Instead of writing the home page as one long page on define_main_page.php, for maintenance and a lot of updating that I do, I wanted to organize sections in php includes.

    Example my regular websites index.php pages, I would take the six image section on https://uesakausa.com put that in its own php file then on the index page I would use one line a php include() function.

    <?php include('sixPictureSection.php') ?>

    Then I can swap those out easily.

    In the zen cart I would need to know what directory to save the sixPictureSection.php in so the define_main_page.php would know where to find it. I am just assuming I can do that.

    Thanks!
    There are a couple of different "core" Zen Cart functions that can help with this:

    From a template directory (e.g. /includes/templates/YOUR_TEMPLATE/templates) to search for yourfilename.php in the templates subdirectory:
    Code:
    require($template->get_template_dir('yourfilename.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/yourfilename.php'); ?>
    That will pull in /includes/templates/YOUR_TEMPLATE/templates/yourfilename.php, if it exists there. If not, it will pull in /includes/templates/template_default/templates/yourfilename.php. If not found there, a PHP error will result.

    From the modules directory (e.g. /includes/modules/YOUR_TEMPLATE/yourfilename.php):
    Code:
    require(DIR_WS_MODULES . zen_get_module_directory('yourfilename.php'));
    That will pull in /includes/modules/YOUR_TEMPLATE/yourfilename.php, if it exists there. If not, it will pull in /includes/modules/yourfilename.php. If not found there, a PHP error will result.

  6. #6
    Join Date
    Apr 2009
    Posts
    60
    Plugin Contributions
    0

    Default Re: How can I be using include() on define_main_page.php

    Thanks lat9! That makes sense and it is what I was trying to figure out. It will help make it more organized and manageable for me.

 

 

Similar Threads

  1. how to relocate content of define pages?
    By tony_sar in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 12 Feb 2012, 12:37 AM
  2. Replies: 3
    Last Post: 5 Jun 2009, 09:24 PM
  3. Linking to Ez-pages from custom header
    By squire11 in forum Basic Configuration
    Replies: 2
    Last Post: 4 Nov 2007, 09:19 AM
  4. Custom Dynamic Extra Pages with URL parameters, GET, POST - for Define and EZ Pages
    By bjoly in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 24 Jul 2006, 04:04 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR