marklevine |
Jul 24, 2013 08:22 AM |
Problem including subtemplates from virtual templates: workaround included
I have seen past threads about the difficulty to include physical subtemplates from within virtual main templates and I believe that this feature remains broken in Montezuma 1.1.9.
Why would you do this? One simple example it to call something like strtoupper(). My client's design requires the_author() to be displayed in uppercase. To support this, I created a tiny subtemplate called "author_to_uppercase.php" but when I tried to include it in my virtual main template, the call failed.
There is a previous patch for this problem for version 1.1.6. Only one third of that patch (with modification) is needed in 1.1.9. You must edit montezuma/includes/get_whitelist.php and add:
Code:
'bfa_get_template_part' => array(
'type' => 'function',
'examples' => array(
"<?php bfa_get_template_part('name-of-sub-template', ''); ?>"
=> 'Including custom sub templates in a main template - Note: the second parameter is reserved',
),
'info' => ' ',
),
into $wl_global array. Note 'info' *must* have a value. The original patch omitted this.
|