Search Wordpress Site and External (Non-Wordpress) Site Search Form with Radio Buttons - wordpress

I'm trying to duplicate the search box on this site : https:clearviewlibrary.org over on a Wordpress install here: https://news.clearviewlibrary.org
I was able to get the search box to execute a search on the external site with this code:
<div>
<form method="get" action="javascript:void(0)"
onsubmit="window.open('http://www.wsld.info/#section=search&term<%=Config%>#section=search&term='+this.term.value+'', '_blank');return true;">
<label>
<input type="text" class="searchform" name="term" placeholder="Search Our Catalog" /></label>
</form>
</div>
but I'm stumped on how to go about adding the additional search functionality and radio buttons.
I've tried taking the code from the clearviewlibrary.org site, but that didn't work. I also saw this, but would rather not have the two buttons : HTML form action search, one text box, 2 buttons, 2 possible results
Thanks,
Brad

Related

Wordpress submit_button() not showing in custom plugin settings page

I have a very small custom plugin that all of a sudden is not displaying the 'Save Changes' button at the bottom of the settings page being added via add_options_page function.
The rest of the form is there, and the button shows locally but for some reason it is not showing up on the live site (v4.1.1). I have tried removing the submit_button() function and adding the line below instead but no joy.
Also, I don't have any check thats says only certain users can see the button.
<input type="submit" name="submit" id="submit" class="button button-primary" value="Save Changes">
Any suggestions?

Some WordPress page links redirectinf to home page

Links from the menu are directing correctly but links like the one in the page below are SUDDENLY not.
http://tazara.mwanawanga.com/?page_id=94
I gave searched on this topic. I have tried reseting permalinks and deactivating/activating plugins. Neither seems to work. I have also tried changing the theme. Still nothing.
Any helpful suggestions are welcome
You have a problem with the form that does the redirect on that button. See below
<form method="link" action=" http://tazara.mwanawanga.com/?page_id=389">
<input type="submit" value="View fare charts and train timetables">
</form>
If you can see, theres a space in the action field of the form which will error the form's action and go to the root.
Try changing it for this:
<form method="link" action="http://tazara.mwanawanga.com/?page_id=389">
<input type="submit" value="View fare charts and train timetables">
</form>
The same will probably go for many other buttons on the site doing the same thing. I would personally recommend not using forms though and just creating a class which has the same styling as a form submit button and using a tags to link. It will be more search engine friendly and easier to use and maintain.

Drupal WebForm With PinPointe--Avoid Confirmation Page

Our company uses PinPointe for email marketing and we have a Drupal 6 site with several language domains. I have created a web form except I did not create any fields in Drupal. Instead in the node Edit NOT THE NODE WEBFORM EDIT....in the node edit for the body section I added the HTML and the javascript for form. Everything works well and the data is captured to pinpointe. The problem lies in the fact that the page..upon clicking submit..actually redirects to PinPointe where I get a friendly message saying. Thanks for joining. Well I don't want this. I would like to just pop an alert saying thanks and leave the user on the page they were on. I tried this code for using jquery to do the post but it isn't loading and I suspect that's because I need it in the header not the body.
So all I want is to submit the data to pinpointe and not redirect the user. So here is where my limited Drupal knowledge runs out:
If I create the input fields in the node webform then how do I get the form to post to pinpointe?
If I create the fields dynamically in the node body (not node>>webform) I can direct the submission to PinPointe but then how do I stop the redirect?
FWIW here is the jquery I was trying to use but suspect has to go in the header http://jsfiddle.net/4xDFK/4/
FWIW here is the code for the dynamic creation:
<form action="http://na04.mypinpointe.com/...." id="webform-client-form-1375" method="post" onsubmit="return CheckForm257(this);">
<div>
<div id="webform-component-UsrEmail">
<div id="edit-submitted-UsrEmail-wrapper">
<input id="edit-submitted-UsrEmail" name="email" size="30" type="email" />
</div>
</div>
<div class="form-actions form-wrapper" id="edit-actions">
<input class="form-submit" id="edit-submit" name="op" type="submit" value=" " />
</div>
</div>
</form>
Create your custom confirmation page in Drupal. Then set up PinPointe to redirect to this confirmation page.
In the PinPointe form manager, there is a option under the 'Thank you page options' to send a signup user to a custom URL.

Post form without a button

I was exploring the search box on the Apple website and noticed it doesn't have a input type="submit" to post the form, even when Javascript is disabled.
<form action="/search/" method="post" class="search" id="g-search">
<div class="sp-label">
<label for="sp-searchtext">Search</label>
<input type="text" name="q" id="sp-searchtext" accesskey="s">
</div>
</form>
Having never really explored it, I take it from this it means you can post a form without needing a submit button, it just relies on the user pressing the return key.
Two questions: 1) Is this compatible across all browsers? So in IE 7 will pressing return still work?; 2) Is there a way to do this in ASP.NET without using an asp:button? I will probably have it inside a placeholder (where I would conventionally use defaultButton to allow for multiple forms on the page) but if I can get rid of the button altogether then that's a plus.
yes of course it is possible to do it in anyway you want.
The simpler thing is to have an onclick event that calls a function that does the submit like this:
JQuery:
$('#id_of_form').submit()
javascript:
document.name_of_my_form.submit();
or
document.getElementById('id_of_my_form').submit();
so simple :)

Drupal path problem - views vs node

I've got a problem with my site search not linking properly to my views pages. I've got a views page set up to display recipe data. It has the URL properties of:
index.php?q=recipe/%1/%2
where %1 is the recipe category, for example, breakfast, and %2 is the recipe name, for example, Muffin. The view goes through the recipe node content, and display it as appropriate. The problem is that the site search module doesn't link to the view, it links to the node which still can look like:
index.php?q=node/22
If I edit that node with an URL alias I can turn it into say:
index.php?q=recipe/muffin
But: this clashes with the view display on the site and the search function takes them to the NODE and not to the VIEW. I really, really need them to be taken to the view.
Is that clear?
How can it be fixed?
Edit: the view has variables for both recipe category and recipe name (for example, breakfast/muffin). Formatting the node pages themselves was impossible, so we had to use views, I'm afraid.
What does the view do exactly?
If it searches for nodes with the argument (say, "Muffin") in their titles, then I think that you should simply change the view URL to something like search_recipe and be done with it.
If it does do something like displaying a single node (so recipe/muffin would be an appropriate unique id), then why are you using Views for this?
Also, you can replace the site's search page with exposed view filters. It's pretty powerful.
This might work?
I've set up a searchable view form - with some filters exposed in the page (and so in the url).
I've disabled site search, don't need it anyway outside this recipe area, and I think I can build a simple block to $GET (or $POST, i always forget) form data to the view.
The view then reads the url and displays appropriately:
index.php?q=recipes%2Fsearch&time=All&keywords=pie
shows recipes containing "pie" in the title.
Just need to build the form now...
edit - yep this worked a treat!
<form id="search-block-form" action="index.php?q=recipes%2Fsearch&time=All" accept-charset="UTF-8" method="get">
<div>
<div class="container-inline right-search">
<div id="edit-search-block-form-1-wrapper" class="form-item">
<label for="edit-search-block-form-1">Quick recipe search: </label>
<input name="q" value="recipes/search" type="hidden" />
<input name="time" value="All" type="hidden" />
<input id="edit-search-block-form-1" class="form-text" title="Enter the recipe terms you wish to search for." maxlength="128" name="keywords" size="15" type="text" />
</div>
<input id="edit-submit" class="form-submit" name="op" type="submit" value="Search" />
</div>
</div>
</form>
This is kind of a workaround, but:
You can try Google Custom Search Engine as default search, and make Google not see node/* URL's using robots.txt.
Just add this below "# Paths (clean URLs)" in the robots.txt file which is on the Drupal root:
Disallow: /node/
(Don't forget that adding this line will stop search engines from crawling all the node/** URLs.)
Also adding views to the sitemap could be helpful for this process.
I've never tried this process, so I can't be sure if it's working or not ;)

Resources