Robin's Blog

记录 积累 学习 成长

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

This post will show you how to debug umbraco macros, with the click of a browser button.

When you need to debug your macros, either xslt or usercontrols you do this by appending some text to the querystring on the page you need to debug.  The most important for me is ?umbDebugShowTrace=true it shows you the build in stack trace from the .NET framework. You can use this if your macro shows/throws an error, in the trace you can see exactly what went wrong in your xslt- or usercontrol macro. The other one is ?umbDebug=true which will show you what is injected into your macro.

For more information see the book debugging

Some screenshots from Internet Explorer and Firefox

Debugging in Internet Explorer

Debugging in Firefox

The trick is to make some favorite links in your browser containing javascript appending the debug querystring to the current page in browser. This is called bookmarklets.

Installing the debug buttons

Option 1: Install via right click in Internet Explorer
Make sure the "Links" is checked under View ? Toolbars ? Links.
Place the three favorites links in the favorite folder called Links.
Right click on this link: Umbraco Debug and choose "Add to favorites...".
Right click on this link: Umbraco Macro Info and choose "Add to favorites...".
Right click on this link: Umbraco Remove Debug and choose "Add to favorites...".

Option 2: Install via drag'n drop in Firefox
Make sure the "Bookmarks Toolbar" is checked under View ? Toolbars ? Bookmarks Toolbar.
Drag this link: Umbraco Debug up to your Bookmarks Toolbar.
Drag this link: Umbraco Macro Info up to your Bookmarks Toolbar.
Drag this link: Umbraco Remove Debug up to your Bookmarks Toolbar.

Are your buttons not visible after being installed?
Click here to see how to find them in Internet Explorer.
Click here to see how install them in Firefox via option 1

 

 

posted on 2009-11-06 22:23  Robin99  阅读(423)  评论(0编辑  收藏  举报