Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2005
    Location
    United Kingdom
    Posts
    457
    Plugin Contributions
    0

    Default adding content to a page

    Hi, what i am after doing is i want to add some text at the top of the specials and new products etc which needs to change on a regular bases

    Im familiar with template overides and adding extra pages to the shop that can be edited using the define pages editor in the admin, but i have had a look at the templates for specials and new products template and cant figure out how i would add the extra variables to add new content to the page

    anyone point me in the right direction

    Cheers

    Rob

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: adding content to a page

    Take an example of a page that currently works ...

    Contact Us has its own
    /includes/languages/english/html_lincludes/define_contact_us.php

    that you copy to your templates and overrides directory ...

    This is then called by the template file:
    /includes/templates/template_default/templates/tpl_contact_us_default.php

    by the code:
    Code:
    <?php if (DEFINE_CONTACT_US_STATUS >= '1' and DEFINE_CONTACT_US_STATUS <= '2') { ?>
    <div id="contactUsNoticeContent" class="content">
    <?php
    /**
     * require html_define for the contact_us page
     */
      require($define_page);
    ?>
    </div>
    <?php } ?>
    The line:
    require($define_page);

    has the $define_page set in the:
    /includes/modules/pages/contact_us/header_php.php

    in the code:
    Code:
    // include template specific file name defines
    $define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_CONTACT_US, 'false');
    To do the same on the Specials page, you can define that piece of code in your templates and overrides for the:
    /includes/templates/template_default/templates/tpl_specials_default.php

    so that you do not need to change more files than your templates and overrides for this ... and change the constants using contact_us to specials as needed ...

    You would also need to define somewhere the values of the constants:
    DEFINE_SPECIALS_STATUS
    FILENAME_DEFINE_SPECIALS

    That could be done in a file such as:
    /includes/extra_datafiles/extra_define_pages.php

    You can call that what ever you want, but that spells out what the file is for and can be used to add other new defines ...

    Now putting all of this together would let you have a way to change the:
    /includes/languages/english/html_lincludes/define_specials.php
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Aug 2005
    Location
    United Kingdom
    Posts
    457
    Plugin Contributions
    0

    Default Re: adding content to a page

    thankyou, i have it working

    just to make sure ive done it correctly, i will just briefly explain incase you see a way i can streamline it

    /includes/extra_datafiles/extra_define_pages.php
    <?php
    /**
    * @package Pages
    * @copyright Copyright 2003-2006 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    */

    // Specials
    define('DEFINE_SPECIALS_STATUS', '2');
    define('FILENAME_DEFINE_SPECIALS', 'define_specials');
    ?>

    /includes/modules/pages/specials/header_.php
    // include template specific file name defines
    $define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_SPECIALS, 'false');

    /includes/templates/myoveridefolder/templates/tpl_specials_default.php
    <?php if (DEFINE_SPECIALS_STATUS >= '1' and DEFINE_SPECIALS_STATUS <= '2') { ?>
    <div id="contactUsNoticeContent" class="content">
    <?php
    require($define_page);
    ?>
    </div>
    <?php } ?>

    includes/languages/english/html_includes/myoveridefolder/define_specials.php
    this contains my text and images in html format

    Ta for help

    Rob

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: adding content to a page

    Thanks for the update that this is working for you and especially for posting the step by step customizations summary that you made ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 

Similar Threads

  1. adding email address links to page content
    By Interdigital_Designs in forum General Questions
    Replies: 2
    Last Post: 23 Aug 2011, 11:14 PM
  2. Adding extra content to a page ?
    By mjmindustrial in forum General Questions
    Replies: 2
    Last Post: 28 Jul 2011, 03:20 PM
  3. Adding content to main page above and below "Featured" products???
    By aly22 in forum Templates, Stylesheets, Page Layout
    Replies: 13
    Last Post: 12 Sep 2010, 07:52 PM
  4. Adding Content To The Manufacturer Product Page.
    By CoolCarPartsOnline in forum General Questions
    Replies: 0
    Last Post: 30 Jul 2009, 04:14 AM
  5. Adding Content
    By walper in forum General Questions
    Replies: 1
    Last Post: 3 Jun 2006, 05:16 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