This module populates template vars with html fetched by querypath.
The html can be run through different processors like:
- paths_rel2abs: Transforms relative paths to absolute.
- remove_elements: Removes elements from the DOM. Surprise :)
Other modules needs to implement a hook in order to add template vars with querypath fetched html:
function hook_querypath_tpl_vars_settings() {
return array(
'header' => array(
// By now only page is supported.
'templates' => array('page'),
'domain' => 'http://acme.com',
'selector' => '#header',
'cache' => TRUE,
'process' => array(
'paths_rel2abs' => array(),
),
),
'navigation' => array(
// By now only page is supported.
'templates' => array('page'),
'domain' => 'http://acme.com',
'selector' => '#navigation',
'cache' => TRUE,
'process' => array(
'remove_elements' => array('.region-navigation'),
'paths_rel2abs' => array(
'exclude' => array(
'href' => array('/aktiviteter'),
),
),
),
),
);
}
In this case the variables will be present in page.tpl.php :
if ($qtv_header):
print $qtv_header;
endif;
if ($qtv_navigation):