Thread: adding new page

Results 1 to 9 of 9
  1. #1
    Join Date
    Feb 2007
    Posts
    61
    Plugin Contributions
    0

    Default adding new page

    hi,

    I had part of this question in another thread but will move to this one for various reasons with just 1 question and not 20.
    I want to add a new page and add some php.

    I followed the logic of the default page_2 and copied and pasted these files and called them jagpage.

    To create a new page I have

    /includes/modules/pages/jagpage/header_php.php
    /includes/languages/english/custom/jagpage.php
    /includes/templates/custom/templates/tpl_jagpage_default.php
    /includes/languages/english/html_includes/define_jagpage.php

    where it says PAGE_2 I have changed to JAGPAGE in all files. If i type in
    http://localhost/ecommerce/zen/index...n_page=jagpage

    I do get the page with just the contents in japage being displayed and not the define_jagpage.php.

    I am so close but so far.

    This must be the sticking point in the tpl file I have

    --
    <?php if (DEFINE_JAGPAGE_STATUS >= 1 and DEFINE_JAGPAGE_STATUS <= 2) { ?>
    <div id="jagpageMainContent" class="content">
    <?php
    /**
    * load the html_define for the page_2 default
    */

    require($define_page);


    ?>
    ----
    </div>

  2. #2
    Join Date
    Feb 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: adding new page

    --
    <?php if (DEFINE_JAGPAGE_STATUS >= 1 and DEFINE_JAGPAGE_STATUS <= 2) { ?>
    --
    I get rid of this line and other brace
    and added jagpage_filenames.php and it works.

    If I add php code can i do it i the module and do i have to use zencart variables which I have no idea about.

    I have a 300line php code i want to add so what is the simplest way?
    Last edited by jagguy; 24 Feb 2007 at 12:44 PM.

  3. #3
    Join Date
    Feb 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: adding new page

    Hi,

    I just want to know which of the files do i place code to access DB?
    I can add a new file and place php code in some of them and it works.

    I have a module file 'header_php.php' which I was told to put there in zencart variables, and then pass onto tpl file but with zencart how does it do this ?


    I can put php code in 'tpl' file and 'define' file and it works, so can iput it there?

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: adding new page

    /includes/modules/pages/jagpage/header_php.php
    /includes/languages/english/custom/jagpage.php
    /includes/templates/custom/templates/tpl_jagpage_default.php
    /includes/languages/english/html_includes/define_jagpage.php

    If these are really the paths to your files, you will never get them to work.
    You need

    /includes/modules/pages/jagpage/header_php.php
    /includes/languages/english/jagpage/jagpage.php
    /includes/templates/jagpage/templates/tpl_jagpage_default.php
    /includes/languages/english/html_includes/jagpage/define_jagpage.php

  5. #5
    Join Date
    Feb 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: adding new page

    hi,

    I thought you have 1 override filename eg custom . I have used custom elsewhere as well. Ok I will change it but the way i did it works fine .

    If I just use custom as a override then you don't need to create a new folder everytie you add a page, so how come it did work?

    So do I put the php/mysql code in modules and use ZC defined variables to hold the data?

    I can get php/mysql to work in the tpl file and define file no probs.
    Last edited by jagguy; 25 Feb 2007 at 07:54 AM.

  6. #6
    Join Date
    Feb 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: adding new page

    hi,

    I tried setting the paths as staed to jagguy instead of custom as given above.
    This didn't work, and it does work from custom folder as an override.

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: adding new page

    Sorry, I didn't realize you were actually using "custom" as the name of your template. It's just a standard generic word we use...

  8. #8
    Join Date
    Feb 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: adding new page

    Hi,
    No problems mate.

    Do you know this q) though as it has got me beat. I can do it my way but it sounds like I need to use some sort of ZC method to use php/msql.

    So do I put the php/mysql code in modules and use ZC defined variables to hold the data?

    I can get php/mysql to work in the tpl file and define file no probs.

  9. #9
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: adding new page

    That's a question I'm not qualified to answer. I would say probably yes, but I couldn't tell you how. Maybe an experienced PHP coder will pop in.

 

 

Similar Threads

  1. Adding a new page
    By pb4 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 14 Jan 2010, 12:42 PM
  2. Adding new forms to register new user page
    By NeoBlack in forum General Questions
    Replies: 0
    Last Post: 2 Oct 2006, 04:49 PM
  3. adding new page
    By parsek in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 17 Jul 2006, 08:42 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