Address Format via address.php

Home Forums Calendar Products Events Calendar PRO Address Format via address.php

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #102858
    Patti
    Participant

    Trying to “fix” the formatting for addresses in the meta box and on single venue & organizer pages via a custom address.php file placed in the tribe-events/modules folder of my theme. I have already removed the country by commenting out everything under “Get our country”.

    Venue addresses by default look like this in the meta box on single events:
    Venue Name
    123 Any St, Town, State, Zip

    Venue addresses by default look like this on the single organizer view Upcoming Events list:
    Venue Name, 123 Any St, Town, State, Zip

    Where I’m trying to get is this:
    Venue Name
    123 Any St
    Town, State Zip

    I almost got there by simply adding a br tag to the end of the address_out line for the street address and removing commas, BUT then when I view the single venue page, I get double spaced lines for the address and I don’t want that.

    Also, after my “fix”, on the single organizer view I’m getting a comma after the venue name/link and no return. Example:
    Venue Name, 123 Any St
    Town, State Zip.

    I hope I haven’t made this too confusing to read. Thanks for anything you might have to offer.

    #103243
    Patti
    Participant

    Still looking for an answer to this. Although, through some testing I see that using tribe_is_venue, tribe_is_event, and tribe_is_organizer won’t work in this file to check the page type. Not sure how to tell it what/how to display if it’s not registering that info?

    #103271
    Patti
    Participant

    One other thing, and this may be a stupid question, but at the top of the address.php file it says “You can use any or all filters included in this file or create your own filters in your functions.php. In order to modify or extend a single filter, please see our readme on templates hooks and filters”

    I cannot find a “readme” anywhere other than the readme in the main folder and that doesn’t discuss templates hooks & filters all that much. Is this statement referring to the Technical Documentation?

    #103318
    Barry
    Member

    Hi! The various components of the addresses are wrapped in span elements as follows:

    <address class="tribe-events-address">
        <span class="adr">
            <span class="street-address">Parkway</span>
            <span class="delimiter">,</span>  
            <span class="locality">Nanaimo</span>
            <span class="delimiter">,</span>  
            <span class="postal-code">BC</span> 
            <span class="country-name">Canada</span>
        </span>
    </address>

    So though I’m not 100% sure if you mean you want them to be formatted the same way on all pages or just one type (like single event views) but you could probably target these via CSS rather than by adding break tags, etc:

    .tribe-events-address .adr .street-address { display: block; }
    .tribe-events-address .adr .delimiter { display: none; }

    Does that help at all?

    #103339
    Patti
    Participant

    It needs to be as is for the single organizer page (one line with commas), with line breaks and no comma after address for the single event page and remove the extra comma that shows up on single venue page (before city, state zip). I don’t see any clear way of making that happen because the “address” include is not able to tell if it’s being pulled into a venue, organizer, or event page. It will only see itself as a venue page.

    #103345
    Patti
    Participant

    Disregard. I think I have an idea on how to do this.

    #103432
    Patti
    Participant

    This worked:
    .tribe-events-single-section .tribe-events-address .adr .street-address { display: block; }
    .tribe-events-single-section .tribe-events-address .adr .delimiter,
    .venue-address .tribe-events-address .adr .delimiter { display: none; }

    The .venue-address etc. style had to be added to remove that “prefix” comma on that shows up on single venue page.

    #103515
    Barry
    Member

    Excellent, glad you got there 🙂

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Address Format via address.php’ is closed to new replies.