Modify Fields in Search Bar for Events Calendar

Home Forums Calendar Products Filter Bar Modify Fields in Search Bar for Events Calendar

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #131514
    eastbayaa
    Participant

    The Search Bar as it stands on my site currently (I removed the keyword search) displays the following text labels:

    EVENTS FROM (underneath you see the word “Date”)
    NEAR (underneath you see the word “Location”)
    and then a button titled FIND EVENTS

    I would like to make the following changes:
    change EVENTS FROM to MEETINGS FROM
    change Location to City
    change FIND EVENTS to FIND MEETINGS

    I tried to follow the instructions in this thread (https://tri.be/support/forums/topic/modify-near-field-title-in-the-tribe-location-search-bar/) but was unsuccessful using the change translation text recommendation provided.

    I added the following code to my functions.php file in my Child Theme and no change took place.
    ‘add_filter(‘gettext’, ‘theme_filter_text’, 10, 3);

    function theme_filter_text( $translations, $text, $domain ) {

    if($text === ‘EVENTS FROM’ && $domain === ‘tribe-events-calendar’) {

    $text = ‘MEETINGS FROM’;

    }

    return $text;
    }

    Can you please tell me exactly what I need to do to make these three changes?

    In a related issue, I’d really like to do a global replace of the word “Events” and change it to “Meetings”. For example, at the bottom of my list view, I see two links on the left and right sides of the page that say Previous Events and Next Events. This is an instance where I’d like it to read Previous Meetings and Next Meetings. Can you please advise on this as well? Thanks.

    #132787
    Brook
    Participant

    Howdy eastbayaa,

    That is a good question. The text match is case sensitive. So instead of ($text === 'EVENTS FROM' you would want to do $text === 'Events From'. Of course, this is confusing if your theme has a CSS style that changes these to uppercase, which is very common even among some of the default themes. Very good question.

    You can certainly change the wording from events to meetings in all text strings if you want. Using that snippet you already have, remove the $text === ” portion, just check the domain. Then, run a search/replace on any text string that comes through replacing ‘Events’ for ‘Meetings’. This might have some unintended side effects, but it is a simple solution. Probably worth a shot for you, just test it thoroughly.

    Does that make sense? Did that work for you? Please let me know. Cheers!

    – Brook

    #133256
    eastbayaa
    Participant

    Hi Brook,
    In addressing my global text replace (2nd question), you’ve said “Using that snippet you already have, remove the $text === ” portion, just check the domain. ”
    I’m not sure what you mean by “just check the domain.” Can you be more specific please?
    Thanks

    #134228
    Brook
    Participant

    Howdy eastbayaa,

    Sure! You would want to use a conditional like this:

    if($domain === ‘tribe-events-calendar’ || {{other Tribe domains you want to match…}}) {

    $text = // str replace magic

    }

    The bolded text is of course the bits you would want to replace with your code. Hopefully that helps!

    – Brook

    #140649
    eastbayaa
    Participant

    Hi, I did not try the global replace because I need more specific code from you (rather than “str replace magic”) so I went back to attempting to change each instance specifically through the string replace function. I described exactly the way the text is appearing (ALL CAPS or capitalized) in my search bar in the original post of this thread, so it does appear that my theme (Twenty Eleven) is converting things to all caps. I tried making the simple change you suggested, adding the following code to my child theme functions.php file, and it actually broke my site such that any page I attempted to load would just show up blank.

    ‘add_filter(‘gettext’, ‘theme_filter_text’, 10, 3);

    function theme_filter_text( $translations, $text, $domain ) {

    if($text === ‘Events From’ && $domain === ‘tribe-events-calendar’) {

    $text = ‘Meetings From’;

    }

    return $text;
    }’

    Can you please help me figure out the best way to address my initial question posed? Here it is again (these apply to the search bar at the top of the calendar page):
    * change EVENTS FROM to MEETINGS FROM
    * change Location to City
    * change FIND EVENTS to FIND MEETINGS

    #142462
    Brook
    Participant

    Hello eastbayya,

    Sadly, there really is no better way to address your initial question than what I have already outlined. You could certainly remove the all caps styling from your theme so that you see the text in your browser window as it actually is. Or, you can right click on an element whose text you are trying to change, and click inspect (or view source if your browser lacks an inspector). Either one of those routes will give you the elements text without styling, thus the exact text you could match.

    As indicated in numerous areas on our site and purchase pages, the support you have purchased is “guidance” on how to make modifications, not the modifications themselves. This does require that you know some programming so that you can effectively fill in blanks like string replacements. However, I truly want to help you so I am going to go beyond our support policy this once and giving you some exact code. This is the search/replace snippets for all mention of events. As I indicated it might not work quite like we would expect, for various reasons it could cause bugs. 🙁 We won’t know until someone has had a chance to thoroughly test it on their site. Feel free to try it out. If you do find a bug however, please let me know that way I can delete that snippet and remove the link from here.

    Does that clear up my instructions? Thanks in advance for your response. Cheers!

    – Brook

    #144926
    eastbayaa
    Participant

    Thanks for going over and above Brook. I have to admit that I don’t have the programming skills but usually can figure stuff out with a bit of guidance. I plugged in that code you provided and it seems to be doing the trick. I will continue to test and will leave this thread open for a bit so I can add any bugs if I find them. Thanks again!

    #145454
    Brook
    Participant

    You are very very welcome! I left the code running on my site for a few days while running other tests, and never encountered an error. That was very encouraging. Thanks for posting an update.

    – Brook

    #146950
    eastbayaa
    Participant

    Hi Brook, I found a bug.

    With this code in place, I am no longer able to access the backend admin function APPEARANCE>CUSTOMIZE. When I try to go there I get a funky white screen with some gobbledy gook about “Meetings”. I scrolled through all the other APPEARANCE options (Themes, Widgets, Menus, Theme Extension, Theme Options, Header, Background, and Editor) and all of these seem to work fine. It’s just the Customize option that’s messed up.
    Hope that makes sense.

    #146956
    eastbayaa
    Participant

    Actually, correction… it looks like that bug is related to something else. I removed the code, and I’m still encountering the same problem but the white page with gobbledy gook now refers to “Events” rather than “Meetings” so something else I’ve got in place is causing this. Argh.

    Basically I see a hyperlink that says Edit Add Events Countdown and when I click on it, it goes here: http://69.195.124.167/~eastbbc2/wp-admin/customize.php?editwidget=tribe-events-countdown-widget-1&addnew=1&num=2&base=tribe-events-countdown-widget

    Underneath the hyperlink it shows “Events Countdown” in boldface. Any thoughts what might be causing this? I’ve removed all of custom code from my child theme functions.php file. Thanks.

    #148884
    Brook
    Participant

    Howdy again eastbayaa,

    I am glad the snippet is working in that case! In the future please keep in mind that we try to keep it to one issue per topic. We have found that this helps you get faster replies and ensures the best service. In the future if you do have a new issue like this, please open a new topic.

    First of all make sure you are running the very latest 3.5.2 version of PRO, as we are continually optimizing our plugin and fixing issues if they are found. I can not see the link you posted, but it sounds to me like you are facing an issue similar to this:

    In all cases the problem was solved by increasing the memory limit. Often times web hosts will allow you to increase the memory limit on your current server. Here are some helpful links regarding this:

    Keep in mind that WordPress is a powerful application, and our Calendar only adds to that power. Often times the cheapest hosts out there simply will not accommodate all these features, especially once you start having a lot of posts or events.

    If you have further updates to this issue, please do start a new topic and let us know what you have tried. Possibly provide a screenshot of the error. Thank you!

    – Brook

    #150671
    eastbayaa
    Participant

    Hi Brook,
    Sorry for the double topic… I initially continued thread here b/c I thought it was a bug resulting from our code change. In any case, I don’t think memory is the issue. This seems to be some kind of code generated bug because the message that IS appearing has to do with Events. Here is a screenshot of what happens when I try to click APPEARANCE>>CUSTOMIZE (http://69.195.124.167/~eastbbc2/?attachment_id=7675)

    I did follow your advice and boosted the memory in my wp-config.php file using this code ‘define( ‘WP_MEMORY_LIMIT’, ’96M’ );’ and I also called my hosting provider (a WordPress recommended provider) and they said my php.ini file memory is already maxed out at 128MB.

    Any other thoughts? Would you like me to open a new thread?

    #150819
    eastbayaa
    Participant

    Ok, sorry for trouble but this seems to have resolved itself. One thing I did notice today is that there were a lot (and I mean A LOT!) of incorrectly generated recurring events, like over 4000 of them. My guess is that these were somehow created during one of my recent upgrades… they all had duplicate dates in 2015 (I have my recurring events set up only to populate 6 months into the future so not sure why these would have been created). In any case, I deleted them all and now the full functionality of the Admin Appearance panel, including Customize, is working. Thanks for your help with this thread.

    #211586
    Brook
    Participant

    I was just closing out some resolved topics like this one. You are of course very welcome for the assistance eastbayaa! If you have a minute or two, we would love it if you could write a few words about the plugin here. Cheers!

    – Brook

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Modify Fields in Search Bar for Events Calendar’ is closed to new replies.