Thread: basics

Results 1 to 10 of 48

Hybrid View

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

    Default basics

    q1)What is the difference betweena module and template. I see a sidebox has both.
    If I want to add to the sidebox eg extra html then which do i use a template or module?

    q2) How can I change the CSS for a specific sidebox ? Can I use a custom overrides or can't you do this to specific parts?

  2. #2
    Join Date
    Oct 2004
    Location
    Southport, UK
    Posts
    4,244
    Plugin Contributions
    20

    Default Re: basics

    For the second, see this recent post - http://www.zen-cart.com/forum/showthread.php?t=50926

    In terms of sideboxes and pages, the template is the layout (governed by the css in the stylesheet) and the module is the content of the template...

    Not to be confused with the template which governs the overall look of your site and the add-on modules found in the downloads section!

    Check out the tutorials/FAQ - I'm fairly sure there are instructions on creating extra sideboxes soemwhere in there.
    Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
    20 years with Zencart !

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

    Default Re: basics

    ok so if I am going to add html/css/javascript then add it to the template , and if I am going to add content from a DB eh php/mysql then change the module.

  4. #4
    Join Date
    Oct 2004
    Location
    Southport, UK
    Posts
    4,244
    Plugin Contributions
    20

    Default Re: basics

    That's about it... examine (as an example)

    includes/templates/template_default/sideboxes/tpl_information.php

    and includes/modules/sideboxes/information.php

    And don't forget to save changed files to your overrides directory.
    Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
    20 years with Zencart !

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

    Default Re: basics

    Hi,

    What is confusing me is the interaction between modules and templates with php code.
    In zencart modules I see php/mysql code but no echo statements. So if I am to do a new box or modify and existing box, do i need to have a deep understanding of the zencart php code to do it the same way?

    How does zencart output php/mysql data?

    I normally have php and html/css in seperate sections or files. If I need to use php with html code eg a table full of mysql data I just use echo staements with table elements.This makes things simple.

  6. #6
    Join Date
    Apr 2006
    Location
    West Salem, IL
    Posts
    2,888
    Plugin Contributions
    0

    Default Re: basics

    each of the sideboxes will have there own IDs, so you can address style changes in the stylesheet directly for each sidebox....

    example for categories sidebox:
    Code:
    #categoriesContent.sideBoxContent
    example for bestsellers sidebox:
    Code:
    #bestsellersContent.sideBoxContent
    Not all selectors are in the stylesheet so you'll have to add them.

    The modules do the work of preparing the info for display and the template files handle the actual display. In general the info doesn't change but how you want to present it does, so that would be the reason for separating them.
    Last edited by barco57; 18 Feb 2007 at 02:10 AM.
    Mike
    AEIIA - Zen Cart Certified & PCI Compliant Hosting
    The Zen Cart Forum...Better than a monitor covered with post-it notes!

 

 

Similar Threads

  1. v154 Right Back to Basics
    By adb34 in forum Basic Configuration
    Replies: 3
    Last Post: 3 Apr 2015, 04:34 PM
  2. Back to Basics w/a Glitch
    By sammirah in forum Upgrading to 1.5.x
    Replies: 2
    Last Post: 10 Apr 2012, 08:12 PM
  3. layout basics
    By mex in forum Templates, Stylesheets, Page Layout
    Replies: 22
    Last Post: 23 Feb 2007, 05:09 AM
  4. Credit Card Basics
    By LeJerque in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 19 Dec 2006, 04:35 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