Try changing the last line of Andy's global to
$name_slice[0] ? return {TypeT => $name_slice[0]} : return {TypeT => 'No name found'};
Then you should be able to use
<%type_tone($ID)%>
<%if TypeT eq '1000'%>
SHOW THIS IMAGE OR TEXT OR INCLUDE(a certain file)
<%elseif TypeT eq '2000'%>
SHOW THAT IMAGE OR TEXT OR INCLUDE(a certain file)
<%endif%>
$name_slice[0] ? return {TypeT => $name_slice[0]} : return {TypeT => 'No name found'};
Then you should be able to use
<%type_tone($ID)%>
<%if TypeT eq '1000'%>
SHOW THIS IMAGE OR TEXT OR INCLUDE(a certain file)
<%elseif TypeT eq '2000'%>
SHOW THAT IMAGE OR TEXT OR INCLUDE(a certain file)
<%endif%>