Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Montezuma Theme »

Problem including subtemplates from virtual templates: workaround included


  #1  
Old Jul 24, 2013, 08:22 AM
marklevine
 
41 posts · Jun 2010
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.
  #2  
Old Jul 24, 2013, 09:07 AM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
Why not just use CSS to adjust the author to uppercase?
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #3  
Old Jul 25, 2013, 12:56 PM
marklevine
 
41 posts · Jun 2010
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.
  #4  
Old Aug 15, 2013, 12:10 PM
marklevine
 
41 posts · Jun 2010
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.
  #5  
Old Aug 15, 2013, 03:12 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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)

Last edited by juggledad; Aug 15, 2013 at 03:27 PM.

Bookmarks

Tags
bfa_get_template_part, get_whitelist, subtemplate, template, virtual

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
PATCH 113-07: allow use of bfa_get_template_part() in Virtual templates juggledad New Versions & Updates 0 Mar 20, 2013 10:40 AM
[SOLVED] Need help differentiating virtual and physical templates Michael4fm Montezuma Theme 5 Jan 3, 2013 03:30 PM
problems adding subtemplates jerryc Montezuma Theme 1 Oct 14, 2012 11:31 AM
Major problem! Help with templates issue paulae New Versions, & Updating 1 Apr 4, 2009 04:30 PM


All times are GMT -6. The time now is 12:50 AM.


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