Thread: basics

Page 1 of 5 123 ... LastLast
Results 1 to 10 of 48
  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,237
    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
    Over 15 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,237
    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
    Over 15 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,748
    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
    GeekHost - Zen Cart Certified & PCI Compliant Hosting
    The Zen Cart Forum...Better than a monitor covered with post-it notes!

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

    Default Re: basics

    What i wanted to know is am i suposed to follow the zencart way of
    'of preparing the info for display and the template files handle the actual display'.

    I have no idea how to do this, and prefer not to do it to be honest.

    I would really need to know a lot about the zencart code to get php code to interact with zencart logic.

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

    Default Re: basics

    Can you give me an example of what your asking as I don't get the question your asking. If your looking to change the way something looks then most of the work will bed in the stylesheet and tpl_ files. I have not had reason to mess with the logic in the modules files ......yet.
    Mike
    GeekHost - Zen Cart Certified & PCI Compliant Hosting
    The Zen Cart Forum...Better than a monitor covered with post-it notes!

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

    Default Re: basics

    I didn't undertand the module files as they weren't standard php code ideas. Usually a fle with php/mysql uses a echo staement to print to the screen with data from mysql and these modules don't. They set variables for further processing to other files. Bascially i didn't want to code that way.



    So if i wanted to add a box with html,css,php/mysql then i would use the template file.

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

    Default Re: basics

    yes.........I think....don't know never had to put my own php in a sidebox.....try it let me know how it turns out
    Mike
    GeekHost - Zen Cart Certified & PCI Compliant Hosting
    The Zen Cart Forum...Better than a monitor covered with post-it notes!

 

 
Page 1 of 5 123 ... LastLast

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

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