Embed registration page on another page in Drupal? - drupal

Currently you can get to the registration page by going here: user/register
I need to be able to embed the registration form on ANOTHER page. How do I do that?

You could try the method suggested here: http://drupal.org/node/248275
a.k.a. embed the form using the PHP Code input filter:
<?php
print drupal_get_form('user_register');
?>
However, there will be a few gotchas with trying to embed the user registration page anywhere besides /user/register, because of the way Drupal's User module is set up.
It might be better for you to form_alter the user registration form, so you can customize it to fit your needs. Or, you might be able to get by with adding a block specifically to the user registration page.
What exactly are you trying to achieve by adding the registration page somewhere else?

Related

Autofill a form in WordPress

I am using WordPress for building my own website, And I created a form using WP form plugin and users are supposed to fill this form after entering the site and I want parts of the form to be filled automatically for them according to the login information, i.e. name.
So my question is, how can I do this?
You can use jquery or javascript, take ID of that field and run ajax on page load you will get info of use logged in and put that in your field by using jquery parameter .val()

Sitecore Web Forms for Marketers - use current URL within email body

I am trying to build a 'Tell a Friend' form for my Sitecore site using Sitecore's Web Forms for Marketers module and would like to include the URL of the current page within the body of the email. I have set the save action of my form to 'Send Email Message' and was wondering if it would be possible to use some variable to represent the URL of the current page, but can't figure out how to do it.
I noticed that if you link to a page when editing the HTML editor for the email template, the source looks something like this:
Name of page
...so perhaps it is possible to use some similar syntax to get the current context page?
I have also tried setting the save action of my form to 'Tell a Friend' but I can't see how to make this include any email content at all, let alone how to make the email include a link to the current page.
For reference I am using Sitecore 6.5.
I have an idea for this, but its more of a hack. Worth a shot:
Since the Email Editor supports inserting hooks for the dynamic fields (refer to section 4.2.2 of the WFFM User Guide [PDF]), why don't you create a Single-Line Text field on the form, call it "Current Page" and apply a unique CSS class to it (e.g. .current-page)
Using custom CSS, hide the .current-page element and using JavaScript, get the window.location.url and put its value into the .current-page input (the hidden SLT field).
Now you can use the hook [Current Page] in your email body.
Again, this is an untested idea, so I'm not sure if it will work.

custom page in Drupal

hi i have created a website in drupal.In this registration page can be access by following url
http://mysite.com?q=user/register
But i want to make a custom page for registration.
Please give me some guide line , i don't have any idea for this
You want to modify the user registration form,
http://www.google.ca/search?client=safari&rls=en&q=user+registration+template+drupal&ie=UTF-8&oe=UTF-8&redir_esc=&ei=Jn0dTdTzI466sQP4uZ2PCg
a) hook_form_user_register_alter() documentation at http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hook_form_alter/6 b) if you totally cant do what you want with a happy little form altering then you can always hook_menu_alter() the page and use whatever page callback you desire instead of drupal_get_form.
Goto admin/build/modules
Enable Profile module
Add fields in profile and while adding a field make it 'visible during registration'

Display the link but not the CCK form

I have created a form using add new content type and cck fields. I want anonymous users to view the menu item to this form but not the content. So when users click on the link they should get redirected to login page. I have granted the permissions of access all content. Any suggestions please.
Thanks
Kanwal
create node-{YOURCONTENTTYPE}.tpl.php in your theme, then write next code:
<?php
global $user;
if (!$user->uid) {
drupal_set_message('You should login before see this content type');
drupal_goto('user');
}
?>
//HERE CODE FROM STANDARD node.tpl.php of your theme
I would never use the theme layer for access control and redirection, as Nikit suggests.
You could simply create a normal menu link to 'user/login' with "Create content" as menu title. Drupal will automatically hide it when you're logged in.
An even better option, IMHO, is to use the Inline Registration module. As the module page says: "Inline Registration allows anonymous users to register via the node/add page, thus removing a step/barrier from the user actually publishing content." Try it, I think it's a huge usability improvement.

How to use hook alter form in module to register a user and also save some data in another table?

have a general idea on how to use hook alter to modify the feel of the registration form .
However the challenge I have is to not only have the user register, but to save some extra data into another table and then redirect user to a new page.
How would I get about doing that? Please help
Again, it'd be easier to plan what you're trying to do and take advantage of common solutions. I suspect what you're after is the Content Profile module.
add a custom function to your form, according to http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/6#submit-prop for more info
please notice the login page and the login block are different forms, with different form ids for your hook_form_alter.
Just implement hook_user(); when the first parameter is 'register', the registration form is being presented to a user, and the module can change it by adding new form fields (the module needs to return them to Drupal).

Resources