Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Montezuma Theme (http://forum.bytesforall.com/forumdisplay.php?f=53)
-   -   Problem including subtemplates from virtual templates: workaround included (http://forum.bytesforall.com/showthread.php?t=20687)

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.

lmilesw Jul 24, 2013 09:07 AM

Why not just use CSS to adjust the author to uppercase?

marklevine Jul 25, 2013 12:56 PM

Yes, I could use text-transform but I've had cross-browser problems. But that's not the point. The example is meant to show how to use a physical subtemplate called from with a virtual main template. Sorry if my example was distracting.

marklevine Aug 15, 2013 12:10 PM

Will access to bfa_get_template_part() be restored in an upcoming release? It is meant to be available, is documented, was patched in earlier versions. I need to inform a client whether they need to patch get_whitelist.php but I'd rather just have them get a fixed version.

juggledad Aug 15, 2013 03:12 PM

Update: I just putt the change in, packaged it and sent it to the developer

Yes it will get into the next release. I'm not sure how it got dropped, but there were multiple updates and it looks like this piece got dropped. I'll submit this to teh developer and hope he can submit it to WordPress for review (although the review lag could be a couple weeks...sigh)


All times are GMT -6. The time now is 10:46 AM.

Powered by vBulletin® Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.