Umbraco/外掛和擴充套件/TextGen Flat
外觀
一個允許透過扁平 URL 使用 /umraco/TextGen.aspx 的 Umbraco 外掛。
外掛可以從 http://www.darren-ferguson.com/code-bank.aspx 下載
- 將 DLL 複製到您的 Umbraco bin 目錄。
- 在 web.config 中將 /TextGen 新增到鍵 umbracoReservedPaths(此變數是一個逗號分隔的列表)。
- 將以下三個鍵新增到您的 web.config
<add key="fmEnableDebugging" value="false"/> <add key="fmDebugPath" value="C:\TEMP"/> <add key="fmTextGenRequestPath" value="/TextGen"/>
您可以根據需要配置除錯為開啟或關閉。如果找不到除錯路徑,將使用 System.IO.Path.GetTempPath()。
要更改用於呼叫 TextGen.aspx 的扁平 URL 字首,請將步驟 2 和 3 中的 /TextGen 替換為您選擇的自定義字首。
4. 新增一個 httpModules 部分作為 system.web 的子元素(如果您已經擁有此部分,則追加)。
<httpModules> <add type="FergusonMoriyama.TextGenRewrite,FergusonMoriyamaTextGenRewrite" name="TextGenRewrite" /> </httpModules>
您現在可以使用以下扁平 URL 生成影像
<img src="/textgen/This%20is%20a%20pen/arial/48/000000/ff0000/1.aspx">
引數的 URL 段是 textgen.aspx 的引數,並且非常直觀。
如果您遇到任何錯誤或問題,請透過 df at darren hyphen ferguson dot com 給我傳送郵件。