celeste
-
10/20/2011 1:39:14 PM
custom macro parameters
Hi,
I have a need to rewrite URLs (javascript, images, etc) in my layouts to a different format in some circumstances. ex: original: http://www.mysite.com/images/blue.gif new: http://www.myNewSite.com/newimages/blue.gif
I have coded a method that can do this. How do I invoke this method from my layouts? I tried a custom macro, but I cannot understand how to pass in the URL to change.
Using 5.5R2
{% ProcessCustomMacro("ConvertUrl", "|(originalURL)http://www.mysite.com/images/blue.gif") %}
case "converturl": match = true; string originalURL = sender.CurrentParameters[0, 1]; result = Common.ConvertURL(new UriBuilder(originalURL)).ToString(); break;
even with simpler code, it does not execute: case "converturl": match = true; result = "executed"; break;
it does execute if i use only {% ProcessCustomMacro("ConvertURL", "") %}, but I need to provide the URL to convert. how can I do this?
|