Possible to get isolated address items for frontend display?

Support MB Geolocation Possible to get isolated address items for frontend display?Resolved

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #9596
    MemaddogMemaddog
    Participant

    I am using the "Map" field with accompanying "text" field to for the address. The documentation shows how to display the map and echo the latitude, longitude, and zoom level, but it is possible to grab the "city" for example? Since the address text field is a single string of text, there doesn't seem to be a way to echo it on the frontend with included line breaks for formatting. Is this possible or do I need separate text fields to enter the address information separately for display on the frontend?

    #9597
    Anh TranAnh Tran
    Keymaster

    Hello,

    The address field is just a text field. While it's used to auto-suggest the map location, it acts like a normal text field. So you can just use the helper function to get its value and output it in the frontend.

    #11197
    ed@gocloudnine.net[email protected]
    Participant

    Is it possible to do this using a shortcode? Like, to display just the city for example?

    #11217
    Anh TranAnh Tran
    Keymaster

    Yes, the city is just a text field and you can use [rwmb_meta] shortcode to show it:

    [rwmb_meta meta_key="city"]

    For details, please see the documentation.

    #11292
    ed@gocloudnine.net[email protected]
    Participant

    I meant if we use a single field for the auto-suggest, can the result be divided into separate parts, such as City?

    #11297
    Anh TranAnh Tran
    Keymaster

    Hi,

    You need to create a new text field, and bind it to the city data. Please follow the documentation to know how to do that.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.