I am getting data from an outside source to populate some of my fields. It comes in as a string separated with commas. In order to display this data in a list format. I did this:
$commaString = ($items["#markup"]); $NoCommaString = str_replace("," , "<br />", $commaString); $items["#markup"] = $NoCommaString;
In field--field-MYFIELD.tpl.php. So now field displays like this:
item 1 item 2 item 3
item 1, item 2, item 3
Which is exactly what I want, yay! However, I'm new to Drupal and am worried I'm bypassing something or not using an API when I should be. So is there a better way to do this?