Site maintenance: Sun 15 Nov, from 20:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Templates, Stylesheets, Page Layout / Difference between a module and a template?

Difference between a module and a template?

Locked

Started by jbalcony on 29 Nov 2008, 4:01 PM · Views: 2,461

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
29 Nov 2008, 4:01 PM
#1
jbalcony avatar

jbalcony

New Zenner

Join Date:
Nov 2008
Posts:
23
Plugin Contributions:
0

Difference between a module and a template?

Hi - Can someone explain the difference between a module file and a template file (tpl_)? Thanks.

Jason

29 Nov 2008, 4:54 PM
#2
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: Difference between a module and a template?

Not sure I understand your question.

Although you defined a Template file you didn't define a Module file, no basis for comparison.

Anyway, a Module is to alter previously installed files in some way. Be it a Template file or a default Zen Cart file makes no difference to the Module, depending upon the use of the Module.

The learning is in the doing.

Potent Products

29 Nov 2008, 5:46 PM
#3
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Difference between a module and a template?

Generally speaking, a module influences a behaviour of your zenshop, while a template influences an appearance.

eg:

  • a payment MODULE will enable a method (behaviour) for customers to pay for their purchases.
  • the "classic green" TEMPLATE positions elements on your webpage and applies layout structures, colours and design features.

20 years a Zencart User

30 Nov 2008, 1:14 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Difference between a module and a template?

If you're referring to files in /includes/modules vs files in /includes/templates ... then ... whereas the files in /includes/modules/ are used to extract data from the database, crunch numbers, do logic-processing, and prepare data to be sent for display; the files in /includes/templates/ are used simply to render the display of the data built by the modules.
Essentially it boils down to templates being used only for display, and modules being used for business logic and intelligence.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.