Home › Forums › Calendar Products › Events Calendar PRO › Address Format via address.php
- This topic has 7 replies, 2 voices, and was last updated 12 years, 2 months ago by
Barry.
-
AuthorPosts
-
February 10, 2014 at 2:50 pm #102858
Patti
ParticipantTrying 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, ZipVenue addresses by default look like this on the single organizer view Upcoming Events list:
Venue Name, 123 Any St, Town, State, ZipWhere I’m trying to get is this:
Venue Name
123 Any St
Town, State ZipI 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.
February 11, 2014 at 8:57 am #103243Patti
ParticipantStill 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?
February 11, 2014 at 9:22 am #103271Patti
ParticipantOne 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?
February 11, 2014 at 9:55 am #103318Barry
MemberHi! 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?
February 11, 2014 at 10:13 am #103339Patti
ParticipantIt 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.
February 11, 2014 at 10:18 am #103345Patti
ParticipantDisregard. I think I have an idea on how to do this.
February 11, 2014 at 12:49 pm #103432Patti
ParticipantThis 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.
February 11, 2014 at 4:22 pm #103515Barry
MemberExcellent, glad you got there 🙂
-
AuthorPosts
- The topic ‘Address Format via address.php’ is closed to new replies.
