how do you add more variables for head.tpl?

Started by cbarg2004, March 17, 2014, 01:53:06 AM

Previous topic - Next topic

cbarg2004

If in storefront/view/default_html5/template/common/head.tpl I enter the line

print_r (get_defined_vars());

I get an array of all defined variables. Now, how can I add extra variables? Where (what file) those variables are defined and populated?
I know the query, I just don't know where to write it.

Thanks :)

abantecart

i am not clear what variables you look for? Some variable are specific to common, page or block controller

For head, see this controller:
https://github.com/abantecart/abantecart-src/blob/master/public_html/storefront/controller/common/head.php

cbarg2004

Basically I need to get the image of the product url within the head tags for Facebook metatags. I just did it opening a connection in the head.tpl but I don't quite like the idea :-/

eCommerce Core

If this data comes from facebook based on direct access to facebook URL, it needs to be in 'tpl' file

cbarg2004

No, the image URL corresponding to the article you are viewing is in resources, and the URL is in the database (resource_description.resource_path). I had to do a query, even though I didn't want to :-/ but it's working :-)

Forum Rules Code of conduct
AbanteCart.com 2010 -