I’ve recently had a use for a custom “magic” property, specifically one that works like the umbracoRedirect property, but instead of redirecting to a node in the existing Umbraco, I needed it to redirect to a URL (e.g., the client is using a custom gift-card solution and would like to have a “Gift Card” navigation link that just opens that URL).
For the navigation option it’s quite simple for me to just render the custom URL (using a standard property) without hard-coding anything in the macro/partial - that part works fine. But the custom property would enable me to also have the domain.com/gift-card/ URL automatically redirect to the entered URL, without having to write any URLrewrites etc. (and it would seamlessly handle the navigation too).
As with all things code-related, I’m sure there’s more than one way of solving this - just know that if I can solve it with a single file in the App_Code folder and not have to build a DLL, I’ll be very happy ![]()
/Chriztian
This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/72387-how-can-i-create-a-custom-magic-property