plainblack.com
Username Password
search
Bookmark and Share

SQLExt Macro

This macro allows you to query a database (internal or external) within the macro.

It is in raw form, and may need to be cleaned up a bit before someone who didn't know much about sql could be able to use it. It does work very well though as we use it on our site currently with a lot of success.

What does this do? It queries the database in the macro and returns the values entered.

Example:We have 20 products on our website and each product has a different price. We did not want to use the "add a product" in webgui as products currently in webgui are not assets as yet. For this reason we would have to enter the products in each individual site seperately. With this macro it allows us to manage 1 database and use a dynamic macro in all the sites that call the "price", "product number", "sitename", and "ifame id" in all the sites.

macro example:
^SQLExt("config","<b>Price: ^0;</b><br>","select price from config where __archived=0 and sitename=? and product_id=?",^Env("SERVER_NAME");,<tmpl_var menuTitle>);

This macro is used in a custom article template I made for our products that fills in the product info dynamically on the webpage below that displays the product Price for each individual product and changes dynamically per site. In this example I used the webgui sitename to make each site unique and call the information for each article with <tmpl_var menuTitle>.

http://www.treasuresforall.net/product_description

System RequirementsPlease be advised: this contribution was tested with something older than WebGUI 7.5. When this contribution was uploaded there was no field for the author to fill out regarding it's requirements.
Comments
DownloadSQLExt.pm SQLExt.pm
LinksNo Support Offered
Statistics Downloads: 586
Views: 3094
Rating: 0
Updated: 3/16/2007
Keywords macros
NavigationBack to the Bazaar
© 2018 Plain Black Corporation | All Rights Reserved