How to: create UDT to convert $page_alias string to...
Posted: Thu Jan 23, 2014 11:27 pm
I do not hav experience with UDT, and now my brain is off 
Really I thing that this is simple but however I need your help, please.
pagealias is "string-string-string"
gallery dir is "string_string_string"
I try to call page alias inside gallery tag as this:
{Gallery dir="$page_alias"}
It works, but...
But it fails when the alias have "-" and the created gallery dir have "_"
I think that I need an UDT that use this php function:
$alias2dir = str_replace('-', '_', $page_alias);
This is where my brain fails.
I do not understand how to complete my udt.
udt input: page_alias
udt output: alias string converted to dir string
My suggested UDT name is: alias2dir
Thanks in advance for all your help.

Really I thing that this is simple but however I need your help, please.
pagealias is "string-string-string"
gallery dir is "string_string_string"
I try to call page alias inside gallery tag as this:
{Gallery dir="$page_alias"}
It works, but...
But it fails when the alias have "-" and the created gallery dir have "_"
I think that I need an UDT that use this php function:
$alias2dir = str_replace('-', '_', $page_alias);
This is where my brain fails.
I do not understand how to complete my udt.
udt input: page_alias
udt output: alias string converted to dir string
My suggested UDT name is: alias2dir
Thanks in advance for all your help.