Home › Forums › Calendar Products › Community Events › How to remove "state or province" and dropdown
- This topic has 15 replies, 2 voices, and was last updated 11 years, 6 months ago by
Geoff.
-
AuthorPosts
-
October 1, 2014 at 2:51 am #780178
sergioral
ParticipantHello,
As we in Portugal don’t have “state of province”, where can I delete this option in the php/html files. Can you tell me, please, the path? Thanks 🙂
October 1, 2014 at 9:22 am #780841Geoff
MemberHi there, Sérgio, thanks for getting in touch!
I’m afraid that removing the dropdown entirely isn’t currently possible without some custom coding. You could create a theme override of the edit-venue.php template. In there is a line to include the community/modules/venue,php template, which contains the dropdown. You can remove that line in your override and customize the form to output just the fields you’d like.
From there, I’d recommend setting your default country to Portugal in Events > Settings > Default Content.
Does that make sense? Will that work for you? Please let me know. 🙂
Cheers!
GeoffOctober 1, 2014 at 3:47 pm #781562sergioral
ParticipantHello Geoff,
Thank for your message.
I’ll try that and then I’ll let you know if it worked.
ThanksOctober 1, 2014 at 4:58 pm #781695sergioral
ParticipantHello again,
I think that correct file is under Community events/views/community/modules/venue.php
By the way… I tried to setup the path inside the theme folder and it didn’t work.
Is this path correct?
Inside my theme folder/tribe-events/community/views/community/modules/venue.php
Is not working! If i put the changed file inside the Community original folder it works like a charm!Thanks
October 2, 2014 at 7:56 am #782996Geoff
MemberYeah, files in the modules directory cannot be overridden. That’s way you’ll want to override the edit-venue.php template in your theme directory instead, remove the line that includes the <i>venue.php</i> module, then paste the code from venue.php there and edit from there. Are you able to give that a try?
Thanks!
GeoffOctober 2, 2014 at 11:34 pm #784381sergioral
ParticipantHi,
Just to see if I understood the idea… I should change the line with “Venue.php” on edit-venue.php and past there the venue.php code?
I tried that I couldn’t found the line calling the venue.php on edit-event.php (yes, it exists BUT under a comment // ).
I can change what I want but directly on files, which I know that Is not the best solution.
But I’ll keep saved apart the changed files.(Curiosity)By the way… What plugin are you using to acess this forum?! I’m trying to find one with similar functions. Thanks again 😉
October 2, 2014 at 11:36 pm #784384sergioral
Participant(I was talking about the login plugin)
October 3, 2014 at 7:30 am #785018Geoff
MemberHey there, Sérgio
This is the line you’re going to look for in edit-venue.php:
<?php tribe_get_template_part( 'community/modules/venue' ); ?>That’s what calling the modules/venue.php file and where you can pass the code to remove the dropdown. Give that a shot and let me know if you are able to do that.
I believe we’re using bbPress for the forums including the login, but there’s been a lot of customization to it. 🙂
Cheers!
GeoffOctober 5, 2014 at 9:19 am #789232sergioral
ParticipantHello again,
Thanks! 🙂 The last message helped!
BY THE WAY… before the 3.8 update I reported a “bug” concerning translations not showing on community!
With this update the problem is not solved.
I have all the .PO files updated, also.
Please see: https://www.dropbox.com/s/fh5slnfaxap0bzf/Captura%20de%20tela%202014-10-05%2017.15.50.png?dl=0As you can see I have everything in portuguese except “Use Saved Local”. Where can I change the code to correct this? I can’t leave this online with a sentence in English.
Thanks 🙂
October 6, 2014 at 7:58 am #791436Geoff
MemberHey there, Sérgio!
So glad we were able to knock those dropdowns out together! Great work. 🙂
Man, sorry we weren’t able to get the updated translation into the latest release. I know updating language files on all ends is something we have on our radar.
In the meantime, you should be able to drop your .PO files into the /the-events-calendar-community-events/lang directory. However, keep in mind that it will get lost the next time the plugin is updated, so you may actually want to consider using it in your theme instead, if that’s an option for you.
Will that work for you? Please let me know. 🙂
Cheers!
GeoffOctober 6, 2014 at 8:28 am #791520sergioral
ParticipantI’m not sure if I understood… I have the .po files 100% translated. So, the problem is not with these files.
Can you tell me, please, what PHP file do I need to edit?
I’ll save it for future releases. Thanks for your help (this Is the only string missing)October 6, 2014 at 9:00 am #791610Geoff
MemberAh, gotcha! Thanks for clarifying. 🙂
You might want to try writing a function to customize that language. Here is the documentation for the tribe_community_events_venue_select_menu()Â function that echoes the venue select menu. This is what contains the dropdown menu with that label, which which get you what you’re looking for.
Will this work for you? Please let me know.
Cheers!
GeoffOctober 6, 2014 at 9:18 am #791646sergioral
ParticipantI’ll try that BUT the idea was to replace the english strings for portuguese strings. 🙂 I only need the php file name. 🙂 thanks
October 6, 2014 at 9:48 am #791718Geoff
MemberGive this a try in your functions.php file:
add_filter( 'gettext', 'my_event_change_venue_label', 20, 3 ); function my_event_change_venue_label( $translated_text, $text, $domain ) { if ( $translated_text == 'Use Saved Venue:' && $domain == 'tribe-events-calendar' ) { $translated_text = __( 'Your Translated Text Goes Here!', 'tribe-events-calendar' ); } return $translated_text; }Let me know if that helps. 🙂
Geoff
October 6, 2014 at 3:13 pm #792370sergioral
ParticipantI could fix that mixing in the the-events-calendar.class.php (from The events calendar folder). Thanks
-
AuthorPosts
- The topic ‘How to remove "state or province" and dropdown’ is closed to new replies.
