{"id":6270,"date":"2004-09-29T11:59:23","date_gmt":"2004-09-29T18:59:23","guid":{"rendered":"http:\/\/hill-kleerup.org\/blog\/wp\/2004\/09\/29\/mt3-dynamic-publishing-and-smartypants.html"},"modified":"2004-09-29T11:59:23","modified_gmt":"2004-09-29T18:59:23","slug":"mt3_dynamic_pub","status":"publish","type":"post","link":"https:\/\/hill-kleerup.org\/blog\/2004\/09\/29\/mt3_dynamic_pub.html","title":{"rendered":"MT3, dynamic publishing, and SmartyPants"},"content":{"rendered":"<p><a href=\"http:\/\/daringfireball.net\/projects\/smartypants\/\" target=\"_blank\">SmartyPants<\/a> is a text modifier that can be used to turn straight quotes to &#8220;curly quotes&#8221;, dashes to em-dashes &#8212; as they say &#8212; dots to ellipses &#8230; etc.  I&#8217;ve used it for quite some time on my regular MT install, and it lends an air of polish and <s>pretentiousness<\/s> professionalism to the output.<\/p>\n<p>It works just fine under MT 3.11 with static publishing.  However, as expected, it doesn&#8217;t work with dynamic publishing (since all the non-standard tags need to be handled as separate PHP modules).  It doesn&#8217;t cause an error, it just doesn&#8217;t do anything.<\/p>\n<p>Thereby hangs a tale &#8230;<\/p>\n<p><!--more--><\/p>\n<ol>\n<li>A web search dug up a <a href=\"http:\/\/www.michelf.com\/projects\/php-smartypants\/\" target=\"_blank\">PHP version of SmartyPants<\/a>.  Huzzah!  (Note that there is another one <a href=\"http:\/\/monauraljerk.org\/smartypants-php\/\" target=\"_blank\">here<\/a>, but that&#8217;s not what I found first.)\n<li>Download, review the instructions.  No mention of MT, but there is a mention of Smarty (the PHP text rendering engine that MT uses).  The instructions for SmartyPants say, <em>If your program use the [Smarty][sm] template engine, PHP SmartyPants can now be used as a modifier for your templates. Rename &#8220;smartypants.php&#8221; to &#8220;modifier.smartypants.php&#8221; and put it in your smarty plugins folder.<\/em><\/p>\n<li>Try that, since there is an <em>mt\/php\/extlib\/smarty\/plugins<\/em> folder.  Nada.<\/p>\n<li>Hmmmm.  Looking in the <a href=\"http:\/\/www.movabletype.org\/docs\/mtmanual_dynamic.html\" target=\"_blank\">MT dynamic publishing instructions<\/a>, it mentions an <em>mt\/php\/plugins<\/em> directory for &#8220;Third-party MT\/PHP plugins&#8221; (&#8220;Plugin files should be placed in the &#8216;plugins&#8217; directory.&#8221;).<\/p>\n<p>Of course, I have no directory by that name.  Which, given my screwy install, isn&#8217;t a surprise.  So, create one, and try putting <em>smartypants.php <\/em>into that plugins directory.  <\/p>\n<p>Nada.<\/p>\n<li>Okay, try putting <em>modifier.smartypants.php<\/em> into there.  Nope.<\/p>\n<li>Google is my friend.  <\/p>\n<p>Over on an <a href=\"http:\/\/www.sixapart.com\/pronet\/2004\/09\/php_dynamic_pub.html\" target=\"_blank\">6A\/MT article on PHP and dynamic publishing<\/a>, I find &#8220;And with the Smarty framework, there are even more ways to customize the rendering of your page. Another feature available through Smarty is the output filter. An output filter is something that runs after the template has been executed. If, for example, you want to apply a text filtering process over your entire page (not just individual entry text), you can load an output filter to do that&#8221; and instructions on creating an an <em>outputfilter.smartypants.php<\/em> file that goes in the <em>mt\/php\/plugins<\/em> directory.<\/p>\n<p>So I create file as defined, and put it and <em>smartypants.php <\/em>into the <em>mt\/php\/plugins<\/em> directory.  Then I make the mods specified in the <em>mtview.php<\/em> file, reopen the file and &#8230;<\/p>\n<li>Huzzah!  I have <s>smart pants<\/s> curly quotes and the like under dynamic publishing.  Huzzah!<\/ol>\n<p><strong>Note 1<\/strong>: This approach makes SmartyPants pretty ubiquitous through all the text of the (dynamic) blog pages, which means you don&#8217;t have to put the <em>smarty_pants=&#8221;1&#8243;<\/em> statement in the MT tags of your templates (except on static page templates), but which also means you can&#8217;t easily turn it off except through the mechanisms that SmartyPants gives you.<\/p>\n<p>Still, I&#8217;m pleased to have gotten that bit figured out.<\/p>\n<p><strong>Note 2<\/strong>:  SmartyPants does its processing on the fly.  Thus the static\/Perl version slows down your page rebuilds as the text has to be processed at each rebuild (i.e., the text is not stored with curly-quotes in the database, just in the HTML file).  The dynamic\/PHP version is the same, which means that it will slow down your dynamic page displays by some (minor, server-dependent) increment.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SmartyPants is a text modifier that can be used to turn straight quotes to &#8220;curly quotes&#8221;, dashes to em-dashes &#8212; as they say &#8212; dots to ellipses &#8230; etc. I&#8217;ve&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_seopress_robots_follow":"","_seopress_robots_imageindex":"","_seopress_robots_snippet":"","_seopress_robots_primary_cat":"","_seopress_robots_breadcrumbs":"","_seopress_robots_freeze_modified_date":"","_seopress_robots_custom_modified_date":"","_seopress_robots_canonical":"","_seopress_social_fb_title":"","_seopress_social_fb_desc":"","_seopress_social_fb_img":"","_seopress_social_fb_img_attachment_id":0,"_seopress_social_fb_img_width":0,"_seopress_social_fb_img_height":0,"_seopress_social_twitter_title":"","_seopress_social_twitter_desc":"","_seopress_social_twitter_img":"","_seopress_social_twitter_img_attachment_id":0,"_seopress_social_twitter_img_width":0,"_seopress_social_twitter_img_height":0,"_seopress_redirections_value":"","_seopress_redirections_enabled":"","_seopress_redirections_enabled_regex":"","_seopress_redirections_logged_status":"","_seopress_redirections_param":"","_seopress_redirections_type":0,"_seopress_analysis_target_kw":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3],"tags":[],"class_list":["post-6270","post","type-post","status-publish","format-standard","hentry","category-blogging"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":6268,"url":"https:\/\/hill-kleerup.org\/blog\/2004\/09\/29\/mt3_and_acronym.html","url_meta":{"origin":6270,"position":0},"title":"MT3 and Acronym","author":"***Dave","date":"Wed 29-Sep-04 2:56pm","format":false,"excerpt":"The Acronym plugin works fine with MT3 -- in static mode. Not surprisingly (since it's invoked very similarly to SmartyPants), it doesn't work in dynamic mode. No idea if\/when someone...","rel":"","context":"In &quot;Blogging &amp; Internet&quot;","block_context":{"text":"Blogging &amp; Internet","link":"https:\/\/hill-kleerup.org\/blog\/category\/blogging"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6381,"url":"https:\/\/hill-kleerup.org\/blog\/2004\/09\/13\/more_mt_31x_stu.html","url_meta":{"origin":6270,"position":1},"title":"More MT 3.1X stuff","author":"***Dave","date":"Mon 13-Sep-04 2:32pm","format":false,"excerpt":"Continuing to pre-plan on the MT311 conversion. Neil Turner has Nine steps to a quicker MT3.1x installation -- though by that he means speeding up your MT site, not installing...","rel":"","context":"In &quot;Blogging &amp; Internet&quot;","block_context":{"text":"Blogging &amp; Internet","link":"https:\/\/hill-kleerup.org\/blog\/category\/blogging"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":157,"url":"https:\/\/hill-kleerup.org\/blog\/2003\/06\/05\/tales_from_the.html","url_meta":{"origin":6270,"position":2},"title":"Tales from the Database","author":"***Dave","date":"Thu 5-Jun-03 2:14pm","format":false,"excerpt":"Figured out a way around the problems I was having with the limited form sizes truncating the MT entries into WIST. I can save each letter's entries as an HTML-tag-embedded...","rel":"","context":"In &quot;Quotations (WIST)&quot;","block_context":{"text":"Quotations (WIST)","link":"https:\/\/hill-kleerup.org\/blog\/category\/blogging\/wist"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10469,"url":"https:\/\/hill-kleerup.org\/blog\/2007\/01\/08\/mt_plug_ins_on_parade.html","url_meta":{"origin":6270,"position":3},"title":"MT Plug-ins on Parade!","author":"***Dave","date":"Mon 8-Jan-07 11:16am","format":false,"excerpt":"For you Movable Type users out there, 6A is having a survey of \"official\" plug-ins -- which ones are used, which ones should be bundled with the installation, which one...","rel":"","context":"In &quot;Blogging &amp; Internet&quot;","block_context":{"text":"Blogging &amp; Internet","link":"https:\/\/hill-kleerup.org\/blog\/category\/blogging"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9551,"url":"https:\/\/hill-kleerup.org\/blog\/2006\/06\/06\/timing_out_is_e.html","url_meta":{"origin":6270,"position":4},"title":"Timing Out is Everything","author":"***Dave","date":"Tue 6-Jun-06 9:26am","format":false,"excerpt":"I was having some odd problems with my WDW 06 category, where it wouldn't actually come up with any content when I went to it. Not all the archives were...","rel":"","context":"In &quot;Blogging &amp; Internet&quot;","block_context":{"text":"Blogging &amp; Internet","link":"https:\/\/hill-kleerup.org\/blog\/category\/blogging"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6272,"url":"https:\/\/hill-kleerup.org\/blog\/2004\/09\/29\/dynamic_publish.html","url_meta":{"origin":6270,"position":5},"title":"Dynamic publishing in MT3","author":"***Dave","date":"Wed 29-Sep-04 9:52am","format":false,"excerpt":"One of my major reasons for taking the MT 3.11 plunge is the prospect of dynamic publishing -- that a blog page gets rendered on the fly when you go...","rel":"","context":"In &quot;Blogging &amp; Internet&quot;","block_context":{"text":"Blogging &amp; Internet","link":"https:\/\/hill-kleerup.org\/blog\/category\/blogging"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/hill-kleerup.org\/blog\/wp-json\/wp\/v2\/posts\/6270","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hill-kleerup.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hill-kleerup.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hill-kleerup.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hill-kleerup.org\/blog\/wp-json\/wp\/v2\/comments?post=6270"}],"version-history":[{"count":0,"href":"https:\/\/hill-kleerup.org\/blog\/wp-json\/wp\/v2\/posts\/6270\/revisions"}],"wp:attachment":[{"href":"https:\/\/hill-kleerup.org\/blog\/wp-json\/wp\/v2\/media?parent=6270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hill-kleerup.org\/blog\/wp-json\/wp\/v2\/categories?post=6270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hill-kleerup.org\/blog\/wp-json\/wp\/v2\/tags?post=6270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}