
Originally Posted by
DrByte
I think the link above is what TinaS was referring to.
While the about-us contribution doesn't pull data from the database, it does demonstrate the infrastructure used for a new "page" in Zen Cart (ie: one that can be accessed via ...index.php?main_page=blahblah
You can build all the DB-query code you want inside the module file (in this case includes/modules/pages/about_us/header_php.php -- stuff the output into relevant variables, and then use the tpl_about_us_default.php template file to loop thru its content with appropriate echo statements as needed (or no loop if not an array, etc).
Generally, a "module" prepares data which can be used "for" display. This can be extracting from database, parsing POST/GET data, accessing external resources, etc.
The "language" files are used to define language-specific text "for" output.
The "template" files are used to render actual output. Sometimes this is done via include() and sometimes by echo ... sometimes both.