jimie VIP
Total posts: 531
08 Apr 2014 13:54

Hello Sergey

Can you tell me how i`m able to show the country, city name from geo field with custom code ?

Like we do with fields value

fields_by_id[61]->result; ?>

I tried this:

field_by_id[150]->value['address']['country']; ?>, field_by_id[150]->value['address']['city']; ?>

but seams it dont show the value

rgds

Last Modified: 09 Apr 2014


pepperstreet VIP
Total posts: 3,837
08 Apr 2014 23:09

jimie show the country, city name from geo field with custom code ?

Here is a topic with valuable info and syntax examples:
How to display address field twice in record but have one with no map?


jimie VIP
Total posts: 531
09 Apr 2014 06:00

Hello Pepper

Sorry but it dosnt help me, I`ve tried those suggestions but cant find the right formula to display those geo filed address values

rgds


jimie VIP
Total posts: 531
09 Apr 2014 10:37

Oky I sorted this out, topic can be marked as solved


Sergey
Total posts: 13,748
09 Apr 2014 11:09

Can you share how you did it?


jimie VIP
Total posts: 531
09 Apr 2014 11:28

First I`ve used var_dump to see the value inside that field with:

<php echo var_dump($item->field_by_id[121]->value); ?>

The I displayed the values I needed ( country, city ) with this:

<?php echo $item->fields_by_id[121]->value['address']['country']; ?>
<?php echo $item->fields_by_id[121]->value['address']['city']; ?>

Hope it helps others rgds

Powered by Cobalt