Change address format

This topic contains 7 replies, has 5 voices, and was last updated by  justmark 5 years, 4 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #453637

    Ricki Steigerwald
    Expired Member
    Post count: 6

    I want to change the layout for the address so the country is not displayed and city, state and postal code on the same line. In V1, I used the hook, geodir_show_post_address, to make these changes. This code doesn’t work for V2.

    How do I do this in V2? Is it all CSS or are there hooks available?

    Also, is there a listing of all the hooks available for V2?

    Thanks,
    Ricki

    #453638

    Ricki Steigerwald
    Expired Member
    Post count: 6

    I found where I can hide the country in the Field settings for address, but like I mentioned above, I would like to change the layout.

    #453692

    Alex Rollin
    Moderator
    Post count: 27815

    Hello,

    This is an enhancement that has had some planning but has not yet been implemented. I will flag your topic for the developers.

    #453771

    Ricki Steigerwald
    Expired Member
    Post count: 6

    Thank you.

    #453834

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Ricki,

    for now u can use this filter:

    
    
    add_filter('geodir_cf_address_template','_my_new_address_format');
    function _my_new_address_format($format){
    $format = "%%street_br%% %%neighbourhood_br%% %%city_br%% %%region_br%% %%zip_br%% %%country%%"; // default
    return $format;
    }

    u can swap the orders and if you remove the _br it will remove the line break, so %%street%% instead of %%street_br%%

    Stiofan

    #457392

    Carin Handsun
    Expired Member
    Post count: 178

    Thank you Stiofan, I was finally able to get my address correct with this code, removing the _br, was what I needed.

    #461145

    justmark
    Full Member
    Post count: 375

    Where am I supposed to add this?

    #461146

    justmark
    Full Member
    Post count: 375

    Never mind….

Viewing 8 posts - 1 through 8 (of 8 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket