{"id":6172,"date":"2009-07-18T13:38:03","date_gmt":"2009-07-18T13:38:03","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/template-provisioning\/"},"modified":"2011-02-13T11:52:33","modified_gmt":"2011-02-13T11:52:33","slug":"template-provisioning","status":"closed","type":"plugin","link":"https:\/\/cn.wordpress.org\/plugins\/template-provisioning\/","author":182984,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"0.2.5","stable_tag":"0.2.5","tested":"3.0.5","requires":"2.8","requires_php":"","requires_plugins":"","header_name":"Template Provisioning","header_author":"Jason Tremblay","header_description":"","assets_banners_color":"","last_updated":"2011-02-13 11:52:33","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/www.bigbigtech.com\/","header_plugin_uri":"http:\/\/www.bigbigtech.com\/wordpress-plugins\/template-provisioning\/","header_author_uri":"http:\/\/www.alertmybanjos.com","rating":0,"author_block_rating":0,"active_installs":10,"downloads":2031,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.1","0.2","0.2.1","0.2.2","0.2.3","0.2.4","0.2.4.1","0.2.4.2","0.2.5"],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[356,229,975,1141],"plugin_category":[43,59],"plugin_contributors":[94895],"plugin_business_model":[],"class_list":["post-6172","plugin","type-plugin","status-closed","hentry","plugin_tags-css","plugin_tags-javascript","plugin_tags-template","plugin_tags-theme","plugin_category-customization","plugin_category-utilities-and-tools","plugin_contributors-jasontremblay","plugin_committers-jasontremblay"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/template-provisioning.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<h4>Overview<\/h4>\n\n<p>The Template Provisioning plugin automatically links to stylesheet and javascript files in your theme directories based on the template file that renders a page. It searches in several pre-defined locations for files, and includes whichever files are found.<\/p>\n\n<p>I wrote this plugin because I prefer this method to using Wordpress's conditional tags in my header.  Keeping resources for different templates separate helps me keep my custom theme directories clean and organized.<\/p>\n\n<p>For example, if I have a custom template \"map.php\" that is being used by a static page, I can create \"css\/map.css\" and \"js\/map.js\" files and they'll be automatically linked-up by this plugin.<\/p>\n\n<h4>Requirements<\/h4>\n\n<p>Will this plugin work with your theme? Probably. It's completely additive, and doesn't change anything that would affect other plugins.  I have been using most of this code since Wordpress 2.5 or so.  But be warned... I haven't thoroughly tested it across versions of Wordpress.  I'll try to do that soon and post the results.<\/p>\n\n<!--section=installation-->\n<h4>Installation<\/h4>\n\n<ol>\n<li>Download and unzip the plugin files (bigbig-template-provisioning.zip)<\/li>\n<li>Move the 'bigbig-template-provisioning' folder into your '\/wp-content\/plugins\/' directory.<\/li>\n<li>Activate the plugin through the Wordpress Admin 'Plugins' page.<\/li>\n<li>Modify your theme, per the usage instructions below.<\/li>\n<\/ol>\n\n<h4>Usage<\/h4>\n\n<p>Using the plugin is easy.  Just create some .css, .less and .js files where the plugin expects them... in the same directory as your template files.  There are a series of files that it looks for when rendering a page using any given template file:<\/p>\n\n<p>Stylesheets for \"&lt;template&#095;name&gt;.php\":\nincluded in page &lt;head&gt; by wp&#095;head() function<\/p>\n\n<ul>\n<li>css\/global.css<\/li>\n<li>css\/ie\/global.css<\/li>\n<li>css\/&lt;template&#095;name&gt;.css<\/li>\n<li>css\/ie\/&lt;template&#095;name&gt;.css<\/li>\n<\/ul>\n\n<p>Javascript files for \"&lt;template&#095;name&gt;.php\":\nincluded in page &lt;head&gt; by wp&#095;head() function<\/p>\n\n<ul>\n<li>js\/global.js<\/li>\n<li>js\/&lt;template&#095;name&gt;.js<\/li>\n<\/ul>\n\n<p>End-of-page Javascript files for \"&lt;template&#095;name&gt;.php\" footer:\nincluded near the &lt;\/body&gt; tag by wp&#095;footer() function<\/p>\n\n<ul>\n<li>js\/global.footer.js<\/li>\n<li>js\/&lt;template&#095;name&gt;.footer.js<\/li>\n<\/ul>\n\n<p>If your script or stylesheet depends on others (i.e. jQuery) being loaded first, simply enqueue them in your template header before the call to wp_head().<\/p>\n\n<p>You can also specify dependencies in comments in included scripts and stylesheets using the following syntax (dependencies should be comma-separated):\n* \/\/ NEEDS: jquery, jquery-cycle<\/p>\n\n<p>NOTE: the above syntax will not actually enqueue the dependencies... it will only require them for our included scripts.<\/p>\n\n<h4>less.js support<\/h4>\n\n<p>As of version 0.2.4, the plugin will also look for .less files<\/p>\n\n<ul>\n<li>css\/global.less<\/li>\n<li>css\/ie\/global.less<\/li>\n<li>css\/&lt;template&#095;name&gt;.less<\/li>\n<li>css\/ie\/&lt;template&#095;name&gt;.less<\/li>\n<\/ul>\n\n<p>If you have the \"less.js\" javascript file in the expected location, it will also be enqueued:<\/p>\n\n<ul>\n<li>js\/less.js<\/li>\n<\/ul>\n\n<h4>Asset host support<\/h4>\n\n<p>As of version 0.2.5, the plugin can be configured to output CSS and JS urls with a base URL from your blog URL.  For example, if have an amazon S3 bucket publicly accessible at http:\/\/assets.yourdomain.com, and it contains \/css and \/js subdirectories, the plugin can link to those instead of to your theme directory.<\/p>\n\n<p>To configure an asset host URL, add the following to your theme's functions.php file:<\/p>\n\n<p>if (class_exists('Template_Provisioning')) {\n  Template_Provisioning::set_asset_host('http:\/\/assets.yourdomain.com');\n}<\/p>\n\n<p>(Note: you probably don't want a trailing slash on that URL)<\/p>\n\n<!--section=faq-->\n<p>None yet... post your questions to the <a href=\"http:\/\/www.bigbigtech.com\/wordpress-plugins\/template-provisioning\" title=\"Template Provisioning Homepage\">plugin homepage<\/a><\/p>\n\n<!--section=changelog-->\n<h4>0.2.5<\/h4>\n\n<ul>\n<li>Added static keyword to functions<\/li>\n<li>Support for configurable asset host<\/li>\n<li>Removed global $is_IE dependency<\/li>\n<li>Using conditional tags for IE styles<\/li>\n<\/ul>\n\n<h4>0.2.4.2<\/h4>\n\n<ul>\n<li>Fixed bug in javascript enqueueing (caused by my last bugfix... I suck :-P)<\/li>\n<\/ul>\n\n<h4>0.2.4.1<\/h4>\n\n<ul>\n<li>Fixed bug in javascript enqueueing<\/li>\n<\/ul>\n\n<h4>0.2.4<\/h4>\n\n<ul>\n<li>Added support for less.js<\/li>\n<\/ul>\n\n<h4>0.2.3<\/h4>\n\n<ul>\n<li>Scripts\/stylesheets can now specify their own dependencies<\/li>\n<\/ul>\n\n<h4>0.2.2<\/h4>\n\n<ul>\n<li>Removed file extension from enqueue handles<\/li>\n<li>Changed \"Required at least\" back to 2.8<\/li>\n<li>Don't enqueue resources on admin pages<\/li>\n<\/ul>\n\n<h4>0.2.1<\/h4>\n\n<ul>\n<li>Use global $is_IE variable to conditionally include IE stylesheets<\/li>\n<li>If WordPress version &lt; 3.0, fall back to old plugin hooks<\/li>\n<\/ul>\n\n<h4>0.2<\/h4>\n\n<ul>\n<li>Plugin now uses WordPress native enqueuing functions<\/li>\n<li>Plugin now looks for global.footer.js and &lt;template&#095;name&gt;.footer.js<\/li>\n<li>Plugin now hooks into \"template_include\" filter instead of separate template filters<\/li>\n<li>Replaced underscores with dashes in plugin \/ directory name<\/li>\n<li>Removed \"BigBig\" prefix from the base class and base file<\/li>\n<\/ul>\n\n<h4>0.1<\/h4>\n\n<ul>\n<li>Initial version<\/li>\n<\/ul>","raw_excerpt":"The Template Provisioning plugin automatically links each blog page to .css and .js files that correspond to its template.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/6172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=6172"}],"author":[{"embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/jasontremblay"}],"wp:attachment":[{"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=6172"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=6172"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=6172"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=6172"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=6172"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=6172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}