Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Plugins & Atahualpa »

Instant Search Suggestions, plugin problem


  #1  
Old Oct 22, 2012, 04:44 AM
rendesr
 
3 posts · Oct 2012
Hello Gang,

I have purchased the following plugin http://bit.ly/X0b52x

It enhances the standard search functionality of the search box, and suggests searches etc.

It doesn't work with the Atahualpa 3.7.9 theme unfortunately.

I contacted the plugin developer, who looked into the problem and came back to me saying:

Quote:
You have onfocus="this.value=''" on your search input. So when a user selects a suggestion the text input is given focus again and it clears the selection instantly. With this removed it seems to work as you would expect. You should be able to edit this in your theme. Ideally it will be an file called searchform.php: http://codex.wordpress.org/Function_...et_search_form

The placeholder text will stay with your javascript removed. You need to have a look at the HTML5 placeholder attribute instead and if you want it to work across all browsers you can look at grabbing a polyfill (https://github.com/ginader/HTML5-placeholder-polyfill). My default WordPress search form looks like this: <snip>

I cannot really follow the code you sent me - its a bit of a mess. All you need to do is remove the onfocus and onblur events and replace it with the placeholder example above.
The code I sent to him was this:
Code:
<div class="searchbox-form">' .
// Since 3.6.8: Removed check whether get_search_query() exists and added esc_js
 * * * * '<input type="text" class="text inputblur" onfocus="this.value=\'' .
* * * * ( get_search_query() ? esc_js(get_search_query()) : '' ) . '\'"
* * * * value="' . (get_search_query() ? esc_js(get_search_query()) : esc_attr($bfa_ata['searchbox_text']) ) .
* * * * '" onblur="this.value=\'' . ( get_search_query() ? esc_js(get_search_query()) :
        esc_attr($bfa_ata['searchbox_text']) ) . '\'" name="s" />' .
'</div>
If I'm honest, I kind of understand what the problem is, but have no idea how to impliment the solution he suggested.

Any help or pointers greatly appreciated.

Steve
  #2  
Old Oct 22, 2012, 05:37 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
try this, edit bfa_header_config.php and change the code
HTML Code:
					<div class="searchbox-form">' . 
					// Since 3.6.8: Removed check whether get_search_query() exists and added esc_js 
						'<input type="text" class="text inputblur" onfocus="this.value=\'' .
						( get_search_query() ? esc_js(get_search_query()) : '' ) . '\'" 
						value="' . ( get_search_query() ? esc_js(get_search_query()) : esc_attr($bfa_ata['searchbox_text']) ) . 
						'" onblur="this.value=\'' . ( get_search_query() ? esc_js(get_search_query()) : 
						esc_attr($bfa_ata['searchbox_text']) ) . '\'" name="s" />' .
					'</div>
to
HTML Code:
					<div class="searchbox-form">' . 
					// Since 3.6.8: Removed check whether get_search_query() exists and added esc_js 
						'<input type="text" class="text inputblur" value="' . ( get_search_query() ? esc_js(get_search_query()) : esc_attr($bfa_ata['searchbox_text']) ) . 
						'" onblur="this.value=\'' . ( get_search_query() ? esc_js(get_search_query()) : 
						esc_attr($bfa_ata['searchbox_text']) ) . '\'" name="s" />' .
					'</div>
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Oct 22, 2012, 06:31 AM
rendesr
 
3 posts · Oct 2012
Thanks JuggleDad - Much appreciated!

That gets part of the problem resolved, the plugin seems to work now, but the 'search this site' text that is in the search box by default, doesn't get removed when the user clicks in the box.

This plugin works with a new install of WordPress, and the plugin support team said I needed to be using HTML 5 just like the vanilla WordPress installation.. You can demo it here: http://wp.scott.ee/

Is this something that can easily be amended in the Atahualpa theme?
  #4  
Old Oct 22, 2012, 07:07 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
why not remove the text? Look in the header options.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Oct 22, 2012, 07:13 AM
rendesr
 
3 posts · Oct 2012
Yeah that's what I will do, but from a UX experience I wanted to keep some indication that the box at the top is the search box.

Many thanks for your help, much appreciated
  #6  
Old Oct 22, 2012, 07:36 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
since according to w3schools.com - the placeholder atribute does not work with IE, why would you want to use it?
if you want you can see what happens if you change teh code.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Plugin suggestions for customizing facebook share/like description text? alena Plugins & Atahualpa 1 Jan 13, 2012 04:50 PM
WPMU search all blogs plugin billc108 Plugins & Atahualpa 3 Aug 28, 2010 04:21 AM
Sidebar navigation plugin suggestions? devarah Plugins & Atahualpa 0 Feb 8, 2010 08:39 PM
Suggestions Please! Need plugin to create rollover images for image map. kippiper Plugins & Atahualpa 0 Nov 15, 2009 04:30 PM


All times are GMT -6. The time now is 09:04 AM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.