Home › Forums › Calendar Products › Filter Bar › Customization/Feature Questions
- This topic has 6 replies, 2 voices, and was last updated 6 years, 8 months ago by Daniel.
-
AuthorPosts
-
June 12, 2017 at 6:42 am #1296605DanielParticipant
Hi,
Above the customized filters is the bar with date, search and near. We haven’t been able to identify how the near is set-up. Is it based on location by zip, by name, by country, etc.
Another question is when they sort by say state, if nothing is in there state, is there a way to have it show the nearest event to that state versus displaying “no result.”
Can we modify the generic “no result” message that appears when no results are generated – though this may be solved by the above question.
Thanks 🙂 Loving the capabilities thus far!
Daniel
June 13, 2017 at 10:07 pm #1297627CliffMemberHi, Daniel.
We call this the Tribe Bar.
The Near search box comes from PRO: /wp-content/plugins/events-calendar-pro/src/Tribe/Geo_Loc.php and other files.
Unfortunately, each of your questions is in the customization realm. I think pointing you to look to PRO is about as much as I can help toward these questions.
Also, the “No results…” messaging is different per view (Month, List, etc.) and therefore would be a bit of a customization as well.
If you need some coding help, you may want to ask your developer or reference our documentation and list of known customizers.
Please let me know if you have any follow-up questions on this topic.
June 15, 2017 at 5:36 am #1298414DanielParticipantOk – in regards to this though, what exactly is near meant to search by? Or is this again based upon the view.
Also, how do we go about changing the label? I have found a few threads but they’re older and don’t appear to be working at this point in time (I could be referencing the wrong ones). We want to change ‘Date’ to ‘Application Deadline’.
Thanks!
June 15, 2017 at 5:47 am #1298418DanielParticipant* Set up the date search in the tribe events bar.
*
* @param array $filters The current filters in the bar array.
*
* @return array The modified filters array.
*/
public function setup_date_search_in_bar( $filters ) {
global $wp_query;
$value = apply_filters( ‘tribe-events-bar-date-search-default-value’, ” );
if ( ! empty( $_REQUEST[‘tribe-bar-date’] ) ) {
$value = $_REQUEST[‘tribe-bar-date’];
}
$caption = esc_html__( ‘Application Deadline’, ‘the-events-calendar’ );
if ( tribe_is_month() ) {
$caption = sprintf( esc_html__( ‘%s In’, ‘the-events-calendar’ ), $this->plural_event_label );
} elseif ( tribe_is_list_view() ) {
$caption = sprintf( esc_html__( ‘%s From’, ‘the-events-calendar’ ), $this->plural_event_label );
} elseif ( tribe_is_day() ) {
$caption = esc_html__( ‘Day Of’, ‘the-events-calendar’ );
$value = date( Tribe__Date_Utils::DBDATEFORMAT, strtotime( $wp_query->query_vars[‘eventDate’] ) );
}
$caption = apply_filters( ‘tribe_bar_datepicker_caption’, $caption );
$filters[‘tribe-bar-date’] = array(
‘name’ => ‘tribe-bar-date’,
‘caption’ => $caption,
‘html’ => ‘<input type=”text” name=”tribe-bar-date” style=”position: relative;” id=”tribe-bar-date” value=”‘ . esc_attr( $value ) . ‘” placeholder=”‘ . esc_attr__( ‘Date’, ‘the-events-calendar’ ) . ‘”><input type=”hidden” name=”tribe-bar-date-day” id=”tribe-bar-date-day” class=”tribe-no-param” value=””>’,
);
return $filters;
}I’ve added this to my functions.php file in the theme and it crashes the page to where it loads empty. I also tried it in the plugins functions general.php file to same affect.
I appreciate your assistance!
June 15, 2017 at 11:36 am #1298680CliffMemberIn our forums we keep our threads focused on just one issue at a time to ensure we fully answer each of your questions/issues. Please keep this in mind for the future. Thanks for your understanding.
1) I’d recommend taking a look at this thread, where they manually created some links to search specific areas (e.g. Los Angeles). They generated these links (to copy/paste from) by using the Tribe Bar’s “Near” search.
2) Please note that our forums don’t handle code well unless you wrap the snippet in the appropriate tags for code… or you could just share a link to it on gist.github.com
Anyway, it looks like you copied setup_date_search_in_bar() from /wp-content/plugins/the-events-calendar/src/Tribe/Main.php — but that’s not how to do this. It’s okay that you’re not a PHP expert, but I’ll again suggest referencing the list of customizers I shared before if you need such customizations.
However, I don’t think you need such code. We have this information regarding translations:
- Translating the premium plugins
- Translating The Events Calendar (free/core plugin)
- How to Override Plugin Language Files (custom language files on your own site)
- Customizing/Changing any bit of text (actual code snippet is at the very bottom) — or using the Say what? plugin (third-party, not guaranteed or supported by us) might be easier to setup and use to do the same thing as our provided code snippet
Please let me know if you need any further assistance.
July 7, 2017 at 9:35 am #1317432Support DroidKeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Customization/Feature Questions’ is closed to new replies.