hi, wonder if someone could give me a hand.

I'm trying to use field_view_value to get a taxonomy value however its printing with link:

<a href="/bands/solange" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Solange</a>

and I just require the "Solange" bit without any HTML, any ideas how to do this? been hunting for some time with no luck.

$bands = field_get_items('node', $node, 'field_band');
$bandsearch = field_view_value('node', $node, 'field_band', $bands[0]);
print render($bandsearch);

Comments

bander2’s picture

You could use:

print $bandsearch['#title'];

But if you already have access to the node, you can also use:

print $node->field_band[LANGUAGE_NONE][0]['taxonomy_term']->name;

- Brendan

Mr. Red’s picture

My field "field_offer_city" is a taxonomy term with a list of cities.

$offer_city = field_get_items('node', $node, 'field_offer_city');
$offer_city_r = field_view_value('node', $node, 'field_offer_city', $offer_city[0], array('type' => 'taxonomy_term_reference_plain'));