Which variables are available in the theme?

hello,

are you familar with the mvc?

basically you have a php controller, which collects data, does some magic und passes this data to smarty to render the views / templates. Sometimes you will find something like this in the templates:


$this->_aViewsData["product"] = $oArticle;
$this->addTplParam("product",$oArticle;);

which are the same and mean, that php “sends” the $oArticle object to the view and in this case you will be able to access this object in the teplate by using [{ $product }]

you can access the functions of your controller by using [{$oView->function()}], here you can find the reference of all functions: http://docu.oxid-esales.com/CE/sourcecodedocumentation/
most controllers have different functions, but they also share some.

another special class is the oxViewConfig, in the template you can access it by [{$oViewConf}], it contains some additional functions and parameters all around the view rendering and its accessible everywhere and its always one the same oxViewConfig. Have a look at the documentation for its functions.

ok, this oxcmp_ stuff… “cmp” means “component”. there are some important classes implemented as components, they are like oxViewConfig and you can access them everywhere in the tenplate.
e.g. oxcmp_user is the current shop visitor.

the usual data flow in templates looks like this:

  • check what you need
  • check the documentations if there is a function for getting this
  • [{$oView->getThatStuff()}]

often there will be no function for this, you you will be able to get the data you need over other objects you can get from oVIew
e.g. on the product page you get your active product from the oView and then you can get alls the product data from the product object.