Pass form data from block to a page view in Drupal - php

I am using the location module and views module for a postcode search, which works fine in a page display using views.
However I want the user to be able to enter their postcode into a block on the homepage and clicking submit my module sends them to the page created in views and the postcode is set as a session S_SESSION['postcode'] before sending to this page, next I want the location page to load but using the session to display the locations automatically.
Any ideas I am using hook_form_submit() and inside that declaring the $form_state as a session and then using $form_state['redirect'] to sent to the views page path.

Ok the way to do this, is to create a mini panel and assign the view to that mini panel and then select the submit handler to go to the views page.

Related

Showing gated and ungated content based on form submission

I have a HubSpot form embedded into a WordPress page.
What I'm trying to achieve is gated and ungated content. See these use cases as an explanation:
User enters WordPress page for the first time on content that is gated by default (by gated
I mean it shows a form).
User fills out the form and gets redirected to whatever is specified as the redirect
option in HubSpot (the content is now ungated).
User closes the window but decided to back onto the WordPress page. Now, since the
user has already filled out the form (the cookie for hubspotutk
exists), I want the user to be redirected straight to the asset
(whatever is specified in the redirect option in HubSpot forms).
How far have I got?
I've created an ACF field in WordPress with radio buttons for Gated or ungated content. By default, all content is ungated.
I've then set a cookie based on this ACF field value. I.e. if the content is gated, resourceType cookie equals "Gated".
That's how far I have got.
The next steps (I think) would be to...
Only "ungate" the page if the user has filled out that form. For example, I've completed a form, the hubspotutk cookie value is "23a43a4a6de9c38f7657ebd08d574scf". How does HubSpot know which form this value is assigned to?
Other concerns:
If the user has filled out the form already, how to I redirect them straight to the asset? Is there a way to get the "redirect to another page" value in the image below as a variable?
I don't want to use HubSpot Forms API because I don't expect the admin to create the forms via the API. They'll want to create it via the HubSpot forms option.
Any ideas?

How to pass values from lightbox to main page

My main application opens an user page. There are New / Edit / Delete buttons on the same page.
I am using Datatables Editor to display records. When I click on New button an lightbox opens up and the datatables editor build-in plugin shows add user template. When this template is submitted a new record is created. The backend has a AUTO_INCREMENT key which I want to be passed back to main page such that I display a message 'User ID : XXXXX has been created'
The issue is that even though I pass it as a session variable the main page which I believe since it is already loaded and cannot be refreshed after lightbox page is submitted - it never receives the updated session variable. As such session variable though set dynamically when user submits lightbox from backend is never seen in main page
How can I achieve the desired output?

How to redirect to home page when user click on Enter or Cancel button in wordpress

i want to make functionality in wordpress just like this here is the Example!
when domain url is loaded first time,registration form will appear and if user click on enter or cancel than it will be redirected to home page after this form would not be appear again in site any where, guide me what files i have to make and where will be the proper placement of those files just like reg-form.php?
use the plugin below to setup popup and it provide html content to add your content/form
http://wordpress.org/plugins/simple-popup/

Using php variable inside a wordpress page through admin interface

I have a wordpress page in which i have a form(used machform which redirects & stores data in session) submitting it redirects to another wordpress page. Now i want to use session value in the second page. I am new to wordpress, can i use php tags inside a page through admin interface so that i can retrieve the session value?
Please help me on this
Thanks
get the exec-php plugin

using static wordpress login form on front page but links to another wp install?

Ok heres the senarrio, i have 4 wordpress installs as follows
top level = mysite.com/ *main site;
1st level = mysite.com/site1 *1st site
2st level = mysite.com/site2 *2nd site
3st level = mysite.com/site3 *3rd site
The front page on the main site has login forms to each of the three sub sites.
each site has different users, settings, content etc...
ie:
form 1
username & pass submit / form action="mysite.com/site1/wp-login.php"
form 2
username & pass submit / form action="mysite.com/site2/wp-login.php"
form 3
username & pass submit / form action="mysite.com/site3/wp-login.php"
when trying to login to any site, it will take the username/pass, submit the form
but come back to the front page were it first loaded, and not directing the user to the
control panel /siteX/
is this something that can be done? or would this require some other way of thinking.
using links to the actual page instead of having the 3 login forms on the one page..?
thanks
You probably want Sidebar Login: http://blue-anvil.com/download/?did=28
If you use this, the user is not redirected to the backend.
I would also advice you to look at WPMU if you are having multiple sites.
Update
You would have to edit the plugin to include a dropdown list, where you could select which site to login to.
Make sure the URLs for each installation is set to the correct value under Settings->General

Categories