View Full Version : SMT items in Global header
RayYates
07-29-08, 07:41 PM
Is it possible to process items (i.e. third party module items) within the Global header/footer or HEAD Tag Content?
I'm guessing the answer is no but this would be a very helpful feature.
Global header and footer are regular templates so the answer is yes. Be careful. The item will only run if it is assigned to the items list on the page that is displaying. If you expect it on every page, then you need to assign the item to every page. If you don't assign it to every page be careful on how you display variables. For example, let's say you have a module render token (item) which reads the basket contents and returns a global variable called baskettotal. Then on the next line you have &mvt:global:baskettotal; If the item is assigned to every page, no problem. You will always have a variable called baskettotal. But if you forget to assign the item to a page, you might not have that variable. Hence a hacker could insert &baskettotal=maliciouscode in the url that calls that page. Your &mvt would run that malicious code. So if you put eval variables which might have a chance of being created outside of your actual page code, you MUST use &mvte:global:baskettotal; That will encode the characters like < and > and some others, thus rendering the malicious code harmless.
RayYates
07-29-08, 08:10 PM
Perfect. Thanks Bill.
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.