{"id":385,"date":"2002-10-29T22:40:30","date_gmt":"2002-10-29T22:40:30","guid":{"rendered":"http:\/\/sunpig.com\/mt-entry-385.html"},"modified":"2006-09-23T19:30:11","modified_gmt":"2006-09-23T19:30:11","slug":"mtrandomline-plugin","status":"publish","type":"post","link":"https:\/\/sunpig.com\/martin\/2002\/10\/29\/mtrandomline-plugin\/","title":{"rendered":"MTRandomLine plugin"},"content":{"rendered":"<p>I&#8217;ve just finished doing the documentation for my first <a href=\"http:\/\/www.movabletype.org\/\">Movable Type<\/a> <a href=\"http:\/\/www.movabletype.org\/docs\/mtmanual_programmatic.html#plugins\">plugin<\/a>, <a href=\"\/martin\/projects\/mt\/randomline\">MTRandomLine<\/a>.  It&#8217;s a tag that extracts and displays a random line from a text file, or a Movable Type template module.  Right now, I&#8217;m using the tag on this page to display the list of random entries you see in the sidebar.<\/p>\n<p>Note that it only performs the random selection when the relevant MT template is <em>rebuilt<\/em>.  It doesn&#8217;t give you a new random selection each time you visit the page.  There are plenty of server-side and client-side scripts around that do that already (just go to the <a href=\"http:\/\/www.movabletype.org\/support\/\">Movable Type support forum<\/a> and do a search for &#8220;random&#8221;).<\/p>\n<p>The tag is probably best suited to doing random quotes, or random images.  It&#8217;s a bit of a stretch (though entirely possible) to make it display random blog entries.  So my next project is to make a &lt;MTRandomEntries&gt; container tag, which will set up a context for a selection of random entries from your blog (or from a category within the blog).  You&#8217;ll then be able to use the normal &lt;MTEntryTitle&gt;, &lt;MTEntryBody&gt; and other tags within it.  Watch out for it soon!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve just finished doing the documentation for my first Movable Type plugin, MTRandomLine. It&#8217;s a tag that extracts and displays a random line from a text file, or a Movable Type template module. Right now, I&#8217;m using the tag on this page to display the list of random entries you see in the sidebar. Note &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/sunpig.com\/martin\/2002\/10\/29\/mtrandomline-plugin\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;MTRandomLine plugin&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-385","post","type-post","status-publish","format-standard","hentry","category-movable_type"],"_links":{"self":[{"href":"https:\/\/sunpig.com\/martin\/wp-json\/wp\/v2\/posts\/385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sunpig.com\/martin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sunpig.com\/martin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sunpig.com\/martin\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sunpig.com\/martin\/wp-json\/wp\/v2\/comments?post=385"}],"version-history":[{"count":0,"href":"https:\/\/sunpig.com\/martin\/wp-json\/wp\/v2\/posts\/385\/revisions"}],"wp:attachment":[{"href":"https:\/\/sunpig.com\/martin\/wp-json\/wp\/v2\/media?parent=385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sunpig.com\/martin\/wp-json\/wp\/v2\/categories?post=385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sunpig.com\/martin\/wp-json\/wp\/v2\/tags?post=385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}