How to remove "state or province" and dropdown

Home Forums Calendar Products Community Events How to remove "state or province" and dropdown

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #780178
    sergioral
    Participant

    Hello,

    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 🙂

    #780841
    Geoff
    Member

    Hi 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!
    Geoff

    #781562
    sergioral
    Participant

    Hello Geoff,

    Thank for your message.
    I’ll try that and then I’ll let you know if it worked.
    Thanks

    #781695
    sergioral
    Participant

    Hello 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

    #782996
    Geoff
    Member

    Yeah, 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!
    Geoff

    #784381
    sergioral
    Participant

    Hi,
    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 😉

    #784384
    sergioral
    Participant

    (I was talking about the login plugin)

    #785018
    Geoff
    Member

    Hey 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!
    Geoff

    #789232
    sergioral
    Participant

    Hello 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=0

    As 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 🙂

    #791436
    Geoff
    Member

    Hey 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!
    Geoff

    #791520
    sergioral
    Participant

    I’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)

    #791610
    Geoff
    Member

    Ah, 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!
    Geoff

    #791646
    sergioral
    Participant

    I’ll try that BUT the idea was to replace the english strings for portuguese strings. 🙂 I only need the php file name. 🙂 thanks

    #791718
    Geoff
    Member

    Give 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

    #792370
    sergioral
    Participant

    I could fix that mixing in the the-events-calendar.class.php (from The events calendar folder). Thanks

Viewing 15 posts - 1 through 15 (of 16 total)
  • The topic ‘How to remove "state or province" and dropdown’ is closed to new replies.