<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>简单生活 —— Kevin Yang的博客 &#187; Writer插件</title> <atom:link href="http://www.imkevinyang.com/tags/writer%e6%8f%92%e4%bb%b6/feed" rel="self" type="application/rss+xml" /><link>http://www.imkevinyang.com</link> <description>It&#039;s all about sharing</description> <lastBuildDate>Mon, 06 Sep 2010 08:00:00 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.1</generator> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Dynamic Template——非常好用的Windows Live Writer动态模板插件</title><link>http://www.imkevinyang.com/2009/04/dynamic-template%e9%9d%9e%e5%b8%b8%e5%a5%bd%e7%94%a8%e7%9a%84windows-live-writer%e5%8a%a8%e6%80%81%e6%a8%a1%e6%9d%bf%e6%8f%92%e4%bb%b6.html</link> <comments>http://www.imkevinyang.com/2009/04/dynamic-template%e9%9d%9e%e5%b8%b8%e5%a5%bd%e7%94%a8%e7%9a%84windows-live-writer%e5%8a%a8%e6%80%81%e6%a8%a1%e6%9d%bf%e6%8f%92%e4%bb%b6.html#comments</comments> <pubDate>Wed, 08 Apr 2009 18:22:00 +0000</pubDate> <dc:creator>Kevin Yang</dc:creator> <category><![CDATA[实用工具]]></category> <category><![CDATA[Dynamic Template]]></category> <category><![CDATA[Live Writer]]></category> <category><![CDATA[WLW]]></category> <category><![CDATA[wordpress动态模板插件]]></category> <category><![CDATA[Writer插件]]></category> <category><![CDATA[动态模板]]></category> <category><![CDATA[插件]]></category> <category><![CDATA[模板]]></category><guid isPermaLink="false">http://www.imkevinyang.com/2009/04/dynamic-template%e9%9d%9e%e5%b8%b8%e5%a5%bd%e7%94%a8%e7%9a%84windows-live-writer%e6%a8%a1%e6%9d%bf%e6%8f%92%e4%bb%b6.html</guid> <description><![CDATA[<p><strong>Dynamic Template</strong>是Windows Live Writer的一个非常强大的插件，它可以很方便的插入各种HTML或者纯文本，减轻你日常写博时的大量重复性劳动。它主要可以完成以下几件事：</p><ul><li>插入普通的HTML文本</li><li>接收用户输入</li><li>操纵选中文本</li><li>使用C#代码</li></ul><h2>普通HTML文本的插入</h2> <img src="http://www.imkevinyang.com/wp-content/uploads/2009/04/image-thumb.png" style="BORDER-RIGHT-WIDTH: 0px; MARGIN: 0px 0px 10px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" height="212" width="608" alt="image" border="0"/><p>如果你经常需要往文章中重复地插入一段固定的HTML文本，如签名等，那么就可以将其存为模板，以后随时插入。<a href="http://www.joecheng.com/code/DynamicTemplate/screencasts/level1.swf">观看演示1</a> <strong>。</strong></p><h2>接受用户输入</h2><p><img src="http://www.imkevinyang.com/wp-content/uploads/2009/04/image-thumb1.png" style="BORDER-RIGHT-WIDTH: 0px; MARGIN: 0px 0px 10px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" height="229" width="683" alt="image" border="0"/></p><p>经常我们需要输入一些格式固定，但是内容变动&#8230;</p>]]></description> <content:encoded><![CDATA[<p><strong>Dynamic Template</strong>是Windows Live Writer的一个非常强大的插件，它可以很方便的插入各种HTML或者纯文本，减轻你日常写博时的大量重复性劳动。它主要可以完成以下几件事：</p><ul><li>插入普通的HTML文本</li><li>接收用户输入</li><li>操纵选中文本</li><li>使用C#代码</li></ul><h2>普通HTML文本的插入</h2><h5><img src="http://www.imkevinyang.com/wp-content/uploads/2009/04/image-thumb.png" style="BORDER-RIGHT-WIDTH: 0px; MARGIN: 0px 0px 10px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" height="212" width="608" alt="image" border="0"/></h5><p>如果你经常需要往文章中重复地插入一段固定的HTML文本，如签名等，那么就可以将其存为模板，以后随时插入。<a href="http://www.joecheng.com/code/DynamicTemplate/screencasts/level1.swf">观看演示1</a> <strong>。</strong></p><h2>接受用户输入</h2><p><img src="http://www.imkevinyang.com/wp-content/uploads/2009/04/image-thumb1.png" style="BORDER-RIGHT-WIDTH: 0px; MARGIN: 0px 0px 10px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" height="229" width="683" alt="image" border="0"/></p><p>经常我们需要输入一些格式固定，但是内容变动的文本，这个时候，就可以使用变量替代法生成动态的HTML文本了。如上面这个示例，它的作用是生成一段"缩写"文本，abbr变量代表缩略语，full变量代表完整文本。这两个变量在插入的时候都是需要用户手动输入的，如下所示。<a href="http://www.joecheng.com/code/DynamicTemplate/screencasts/level4a.swf">观看演示2.</a></p><p><img src="http://www.imkevinyang.com/wp-content/uploads/2009/04/image-thumb2.png" style="BORDER-RIGHT-WIDTH: 0px; MARGIN: 0px 0px 10px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" height="191" width="312" alt="image" border="0"/></p><h2>操纵选中文本</h2><p>很多Windows Live Writer的插件都提供选中一段文章片段进行处理然后重新插入到文章中的功能。Dynamic Template这个动态模板插件也支持。而且使用起来和上面提到的变量替代是类似的。只不过这个变量是插件预定义的（_selection），并且由插件自动捕获用户选择的文本。<a href="http://www.joecheng.com/code/DynamicTemplate/screencasts/level3.swf">观看演示3</a> <img src="http://www.imkevinyang.com/wp-content/uploads/2009/04/image-thumb3.png" style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; MARGIN: 0px 0px 10px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" height="235" width="551" alt="image" border="0"/></p><h2>使用C#代码</h2><p><img src="http://www.imkevinyang.com/wp-content/uploads/2009/04/image-thumb4.png" style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; MARGIN: 0px 0px 10px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" height="73" width="489" alt="image" border="0"/></p><p>如果写过ASP这样的动态脚本页面，那么你可能对上面这样的定义非常的熟悉。Dynamic Template支持C#的表达式和语句来生成动态HTML文本。<a href="http://www.joecheng.com/code/DynamicTemplate/screencasts/level2.swf">观看<span style="TEXT-DECORATION: underline">演示4</span></a></p><p>基本语法：<tt>&lt;%=</tt> <tt>%&gt; 或者&lt;% …; %&gt;</tt></p><p><tt>需要注意，表达式不能以分号结尾，而一条完整的C#语句必须以分号结尾，否则会提示编译出错。（类似</tt>CS1026: ) expected"）</p><p>内置的函数</p><ul><li><tt>HtmlEncode(string)</tt></li><li><tt>HtmlAttributeEncode(string)</tt></li><li><tt>HtmlDecode(string)</tt></li><li><tt>UrlEncode(string)</tt></li><li><tt>UrlPathEncode(string)</tt></li><li><tt>UrlDecode(string)</tt></li><li style="LIST-STYLE-TYPE: none"><p>这些函数对应了HttpUtility的相关方法。</p></li></ul><p>更多的信息请参考作者的主页：<a href="http://www.joecheng.com/code/DynamicTemplate/" title="http://www.joecheng.com/code/DynamicTemplate/">http://www.joecheng.com/code/DynamicTemplate/</a></p><p>下载链接：<a href="http://wlwtemplate.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=7199" title="http://wlwtemplate.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=7199">http://wlwtemplate.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=7199</a></p><p style="TEXT-ALIGN: right">-- <a href="http://www.imkevinyang.com">Kevin Yang</a></p>标签：<a href="http://www.imkevinyang.com/tags/dynamic-template" title="Dynamic Template" rel="tag">Dynamic Template</a>, <a href="http://www.imkevinyang.com/tags/live-writer" title="Live Writer" rel="tag">Live Writer</a>, <a href="http://www.imkevinyang.com/tags/wlw" title="WLW" rel="tag">WLW</a>, <a href="http://www.imkevinyang.com/tags/wordpress%e5%8a%a8%e6%80%81%e6%a8%a1%e6%9d%bf%e6%8f%92%e4%bb%b6" title="wordpress动态模板插件" rel="tag">wordpress动态模板插件</a>, <a href="http://www.imkevinyang.com/tags/writer%e6%8f%92%e4%bb%b6" title="Writer插件" rel="tag">Writer插件</a>, <a href="http://www.imkevinyang.com/tags/%e5%8a%a8%e6%80%81%e6%a8%a1%e6%9d%bf" title="动态模板" rel="tag">动态模板</a>, <a href="http://www.imkevinyang.com/categories/techarticles/usefultools" title="实用工具" rel="tag">实用工具</a>, <a href="http://www.imkevinyang.com/tags/%e6%8f%92%e4%bb%b6" title="插件" rel="tag">插件</a>, <a href="http://www.imkevinyang.com/tags/%e6%a8%a1%e6%9d%bf" title="模板" rel="tag">模板</a><br /><h4 style="background-color:#3B3B3B;border-bottom:2px groove gray;color:#F2F2F2;margin-top:20px;padding:6px 6px 6px 15px;margin:20px 0px 0px 0px">你可能对下面的文章感兴趣</h4><ul class="st-related-posts"><li><a href="http://www.imkevinyang.com/2009/10/wordpress%e8%af%84%e8%ae%ba%e4%b8%ad%e4%bf%9d%e7%95%99html%e4%bb%a3%e7%a0%81.html" title="Wordpress评论中保留Html代码 (2009/10/31)">Wordpress评论中保留Html代码</a> (2009/10/31)</li><li><a href="http://www.imkevinyang.com/2009/12/%e8%a7%a3%e5%86%b3wordpress%e5%8d%87%e7%ba%a7%e5%90%8e%e5%88%9b%e5%bb%ba%e6%96%b0%e9%a1%b5%e9%9d%a2%e6%97%b6%e6%97%a0%e6%b3%95%e9%80%89%e6%8b%a9%e6%a8%a1%e6%9d%bf%e7%9a%84%e9%97%ae%e9%a2%98.html" title="解决Wordpress升级后创建新页面时无法选择模板的问题 (2009/12/07)">解决Wordpress升级后创建新页面时无法选择模板的问题</a> (2009/12/07)</li></ul>]]></content:encoded> <wfw:commentRss>http://www.imkevinyang.com/2009/04/dynamic-template%e9%9d%9e%e5%b8%b8%e5%a5%bd%e7%94%a8%e7%9a%84windows-live-writer%e5%8a%a8%e6%80%81%e6%a8%a1%e6%9d%bf%e6%8f%92%e4%bb%b6.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>