Created
September 25, 2013 15:27
-
-
Save allgood2386/6701334 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by JetBrains PhpStorm. | |
* User: richallen | |
* Date: 9/25/13 | |
* Time: 11:26 AM | |
* To change this template use File | Settings | File Templates. | |
*/ | |
$tidList = array(); | |
$termObjectArray = array(); | |
$links = array(); | |
foreach ($entity->field_related_topics['und'] as $tidArray) { | |
$tidList[] = $tidArray['tid']; | |
} | |
foreach ($entity->field_related_campaigns['und'] as $tidArray) { | |
$tidList[] = $tidArray['tid']; | |
} | |
foreach ($tidList as $tid) { | |
$termObjectArray[] = taxonomy_term_load($tid); | |
} | |
foreach ($termObjectArray as $term) { | |
$termPathArray = taxonomy_term_uri($term); | |
$termPath = drupal_get_path_alias($termPathArray['path']); | |
$links[$term->name] = l($term->name, $termPath); | |
} | |
print implode(', ', $links); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment