Change Custom Topic List delimiter

Permalink
Hello all,

I am pulling a Custom Topic List Attribute into my Blog page. The user has the option to select multiple topics from the list. I want to change the way the list is displayed... rather than using commas to separate the list, I would like to use forward slashes. Let me also mention that the Topics themselves will contain commas, as they are a CITY, STATE.

Currently:
NEW YORK, NY, ATLANTA, GA, SAN FRANCISCO, CA

Preferred:
NEW YORK, NY / ATLANTA, GA / SAN FRANCISCO, CA

Any help would be greatly appreciated.
Craig

vergedesign
 
vergedesign replied on at Permalink Best Answer Reply
vergedesign
In case anyone is interested, I ended up resolving this issue with a bit of a PHP hack. I am sure there is a cleaner way to do this by delving into the core files, but that is way above my pay grade, so I just ran a loop to output the topics like so:

<?php
$locs = $c->getAttribute('my_locations');
if (is_array($locs)) {
  $i = 0;
  if (count($locs)) {
    foreach($locs as $loc) {
      if(++$i !== count($locs)) {
        echo $loc->getTreeNodeDisplayName() . " / ";
      } else {
        echo $loc->getTreeNodeDisplayName();
      }
    }
  }
}
?>