Developer forum

Forum » Development » DwTemplateTags and release mode

DwTemplateTags and release mode

Jon Lennryd
Reply
Hello all,
I wonder if there is any way to instruct dynamicWeb to ignore any DwTemplateTags found? As it is a tag used during development and debugging, it could be nice to have some on/off functionality.

When I develop my own modules, I use a construct like this:

        [System.Diagnostics.Conditional("DEBUG")]
        protected void DebugMessage(string message)
        {
              Dynamicweb.Base.w(message);
        }

And voila, all calls to DebugMessage is gone when I compile in release mode.

Thank's for a great forum!


Replies

 
David Matheson
Reply
This post has been marked as an answer

Could you not surround it with

@If(Global:Extranet.User=XXX)
@DwTemplateTags
@EndIf
or something similar
Votes for this answer: 0
 
Jon Lennryd
Reply

Could you not surround it with

1
2
3
@If(Global:Extranet.User=XXX)
@DwTemplateTags
@EndIf
or something similar
Yep, it would require a specific test-user of course, but that's a good idea if there is no global on/off flag.

I still believe it would be a good idea to let the DwTemplateTags flag depend on a global 'SiteIsInTestMode' flag, as it would allow me to just leave them where they are when I publish the site. Your solution does exactly this of course, but in three lines instead of one.

 

You must be logged in to post in the forum