Macro for pulling metadata or data from the Asset in which it's embedded.
If the first choice is not defined, will return the second choice passed to this routine, from the Asset in which it's embedded.
For example, imagine you have a metadata property called "custom_text".
Use this Macro to display the "custom_text" text if present for the current page, or something else such as the page menuTitle if "custom_text" is not filled in for the current page.
Usage example
^PageIfElse("metadata.your_custom_field", "menuTitle");
^PageIfElse("metadata.your_custom_field");
To get metadata, prepend the metadata name with "metadata."
If the second argument is omitted, the second argument will be the Title from the Asset in which it's embedded.
If the macro is called from outside of an Asset, or if there's no asset in session variable, returns an empty string.
Disclaimer:
I am not a professional perl programmer. Use at your own risk.
Tested on WebGUI 7.10.28-stable.