Plone Search: get method to pass via URL to another site - overriding

I am using Plone 4.3 and the diazo bootstrap theme and want to use the site-search-form to pass the searchterms including two search-options to another site (catalog) via get method.
To achieve this I have modified the plone.searchbox template and changed some content of it:
<div id="portal-searchbox"
i18n:domain="plone"
tal:define="navigation_root_url view/navigation_root_url;
search_input_id view/search_input_id;">
<form id="searchGadget_form" method="get" enctype="application/x-www-form-urlencoded" accept-charset="utf-8" action="http://www.thecatalogadress.net/opensearch">
<div class="LSBox">
<input name="LOCATION"
type="hidden"
value="HAGENBIB" />
<input name="SG1.SG.HAGENBIB:SGHagenvk"
type="hidden"
value="on" />
<input name="QUERY_alAL"
type="text"
size="18"
value=""
title="Finden"
class="searchField" />
<input class="searchButton"
type="submit"
value="search"
i18n:attributes="value label_search;" />
<div class="LSResult" id="LSResult"><div class="LSShadow" id="LSShadow"></div></div>
</div>
</form>
</div>
By now the search term is passed, but the two input-options are not introduced in the URL thus the query in the catalog doesn't work.
The result I need as URL is http://www.thecatalogadress.net/opensearch?LOCATION=HAGENBIB&SG1.SG.HAGENBIB:SGHagenvk=on&QUERY_alAL=test
As I am new to plone I wanted to ask for a hint, where to look at or what to change in order to add the two input-options to the URL.

I think you're probably forgetting to add the proper ZCML directives for the override on the template take place.
Take a look at this tutorial on Overriding Viewlets.

Related

Retrieving a URL via a Wufoo Form

I'm pretty new to using wufoo forms and have been searching for a few days and can't quite find what I'm looking for.
I did find a number of articles about 'URL Modification' but not sure how to implement this for what I need.
We have a simple single wufoo form which is being used across 6 iterations of a client's domains (they are sector specific).
We want (in the email notification and response entry on wufoo) to record which site was used to complete the form (for analytical purposes).
In other words the email to the client should list:
Name: John Smith
Email: Johnsmith#mail.com
Phone: 555-123-1234
From: www.websiteversion1.com
The form is being integrated on Wordpress sites.
Any help would be appreciated!
You can copy the form HTML to your site's templates and modify the form, using PHP to fill in the value of the site url. I don't think WuFoo will automatically fill that field in for you.
First of all, in your WuFoo account forms manager, add a website (url) field and make it visible for admins only (this is a Wufoo option).
Then copy the generated form into your own template.
Now modify your form template so that it grabs the site URL and fills it in for the value of the website field where you want it.
Your form template might look something like this:
<form class="wufoo-form" id="form3" name="form3" accept-charset="UTF-8" autocomplete="off" enctype="multipart/form-data" method="post" novalidate action="#">
<div class="form-group">
<label for="Field1">Name</label>
<input id="Field1" name="Field1" type="text" placeholder="" value="">
</div>
<div class="form-group">
<label for="Field2">Email</label>
<input id="Field2" name="Field2" type="email" placeholder="" value="">
</div>
<div class="form-group">
<label for="Field3">Phone</label>
<input id="Field3" name="Field3" type="tel" placeholder="" value="">
</div>
<div class="form-group hidden">
<label for="Field4">From</label>
<input id="Field4" name="Field4" type="url" class="form-control" placeholder="" value="<?php esc_url( home_url() ); ?>">
</div>
<div class="form-group">
<button id="saveForm" name="saveForm" type="submit" name="submit" class="btn btn-primary btn-lg">Let's talk!</button>
<input type="hidden" id="idstamp" name="idstamp" value="***the_id_for_your_form_wufoo***" />
</div>
</form>

Post form i themeplate Wordpress

I'm building a form to integrate in WordPress. How can i prevent the form from displaying start.php as an new single page when submitting?. I would like to stay in the startform div inside the template. Right now I'm shipped to a new start.php page?
I've tried to change the action to correct path to start.php but it's still same problem?
My file is start.php, I'm using this code to display it:
<div class="startform">
<?php get_template_part( 'start' )?>
<div>
The form is in start.php:
<form method="post" action="start.php">
<input type="submit" id="up_vote" name="vote" value="newmember" />
<input type="submit" id="down_vote" name="vote" value="oldmember" />
</form>
I found my solution by adding the insert script on same page instead of action="start"
<form method="post">
<input type="submit" id="up_vote" name="vote" value="newmember" />
<input type="submit" id="down_vote" name="vote" value="oldmember" />
</form>

Having trouble with form requests

I've setup two pages. 1.aspx, and 2.aspx.
on 1.aspx I have a form like so:
<form action="2.aspx" method="post" id="myform">
<input type="hidden" value="this works" id="mydata" />
<input type="submit" />
</form>
on 2.aspx I have this code:
Response.Write(Request.Form("mydata"))
This returns nothing.
I also tried
Response.Write(Request.Form(0))
but I get "Index was out of range." Message from the server.
I know I'm probably missing something very simple, but, I can't seem to find it!
What am I doing wrong?
Thanks!
ID is used for client-side access. Give your hidden field name="mydata" for server-side form access
Instead of having
<input type="hidden" value="this works" id="mydata" />
have
<input type="hidden" value="this works" name="mydata" />
IF you want to keep id instead of name you have to write it out differently.
you want to use document.getElementById instead of Request.form

Contact Forum from template not working

I have downloaded this fantastic web template called Brushed. It is heavy on css, which I am not too familiar with. I have managed to complete my personal webpage through trial and error, however, I am unable to get the CONTACT FORM to work through my servers.
The code from the template.
<!-- Contact Form -->
<div class="row">
<div class="span9">
<form id="contact-form" class="contact-form" action="#">
<p class="contact-name">
<input id="contact_name" type="text" placeholder="Full Name" value="" name="name" />
</p>
<p class="contact-email">
<input id="contact_email" type="text" placeholder="Email Address" value="" name="email" />
</p>
<p class="contact-message">
<textarea id="contact_message" placeholder="Your Message" name="message" rows="15" cols="40"></textarea>
</p>
<p class="contact-submit">
<a id="contact-submit" class="submit" href="mailto:info#elementsglobal.in">Submit</a>
</p>
<div id="response">
</div>
</form>
Any help would be greatly appreciated.
Thank you.
You need to create a resource (e.g. uri) that you can post your form to on your server. That is, you need to change the following
<form id="contact-form" class="contact-form" action="#">
to something like this
<form id="contact-form" class="contact-form" action="/contact/create">
And, you need to add a resource at "/contact/create" in your server that would parse form variables that are passed in from the post request, and do your thing (either save it to the database table or send yourself an email.
I hope this makes sense.
The contact form wont work because you have the action set to # and you dont have a method of sending the data. So unless you are grabbing this data another way that you dont have posted you should start by fixing these
<form id="contact-form" class="contact-form" action="#"/*Fix this*/ method="post">

how to POST data in appspot when Admin add a post in wordpress

I am new in wordpress. I have an wordpress site where Admin can add post.But when he will add a post, a GET method submission should be also done to appspot http://jhal-muri.appspot.com/sendAll?emailId=emailid&mssg=msg .
How can I do that? I know that I have to change the add_post options in admin panel of wordpress But I don't know how to do.
For Wordpress
You can declare the form as POST. Then, construct your URL string as http://jhal-muri.appspot.com/sendAll?emailId=emailid&mssg=msg where emailId and mssg parameters will automatically become GET. The rest of the input names and values will become POST.
Sample Code
<form method="post" acion="http://jhal-muri.appspot.com/sendAll?emailId=emailid&mssg=msg">
<input type="text" value="" name="emailId" />
<input type="text" value="" name="msg" />
<input type="submit" name="submit" value="Send All" />
</form>

Resources