By zeta1600 on
I have the following code currently:
<?php foreach ((array)$node->field_buy_at as $item) { ?>
<?php print $item['view'] ?>
<?php } ?>
I would like to make the list a drop down with a link so that when a user selects, he goes to a new page. I tried the following:
<select name="select">
<?php foreach ((array)$node->field_buy_at as $item) { ?>
<?php
$url = $node->field_buy_at[0]['url'];
$store = $item['view'];
?>
<? echo "<option value='$url'>$store</option>";?>
<?php } ?>
</select>
I'm pretty sure it's this "$url = $node->field_buy_at[0]['url'];" that I don't have correct.
And, what do I need it to have so that it opens to a new window?
Comments
Found it
Open in same window:
Open it in a new window:
Got some help from
Got some help cleaning up the code at: http://www.phpfreaks.com/forums/index.php?topic=351944.msg1662033#msg166...