You are hereDrupal 7
Drupal 7
Remove/hide Vertical tabs on node edit forms
Node edit forms are not the nicest thing you have seen and new layouts in Drupal 8 that basically copies wordpress style forms are much better. Sometimes you will have clients that can't stand this vertical tabs and would rather not have them at all and probably they will never use them anyway. So best thing to do is to remove them for them. Just add this to your module, which will hide them for them and for user 1 you will still see them.
global $user;
if ($user->uid != 1){
Rules, action for first time logged in user
If you want to have an action happen on user who logs in first time and logs in right after the registration, without email verification. You can use the event "After saving a new user account" problem here is the in conditions you will not have any data about the current logged in user, as he will be logged in after that. So even if you check global $user it looks like the anonymouse user.
Modal CTools redirecting after modal is opened
Usual redirecting wont work if modal is opened. So to do that you need some custom code like this will work for redirecting after loging in.
ctools_add_js('ajax-responder');
$commands = array();
$commands[] = ctools_ajax_command_redirect('first-time-login');
print ajax_render($commands);
exit;
}
There is also a Rules redirect action if you install Modal Forms module, that has redirect modal aware, you can check the code there or just use it if you use rules.
Plain modal form, load on page load
To load just plain moda form and add some contetn to it. Do this
Drupal.CTools.Modal.show();
$('#modal-title').html('put title here');
$('#modal-content').html('put content here');
});
and modal will open.
Loading CTools modal on page load for specific pages
This is my first solution in series of solutions for automatic loading of modal forms. If you have a link on some page that you want to load on page load. You need to first create JS that would make that and then find a way to add that JS to specific pages. So first JS
Drupal.ajax.prototype.specifiedResponse = function() {
var ajax = this;
if (ajax.ajaxing) {
return false;
}
try {
$.ajax(ajax.options);
}
catch (err) {
alert('An error occurred while attempting to process ' + ajax.options.url);
Overriding form, setting something for the first form load
So I am overriding the login form and want to have unique state of the form for the first load screen, when user hasn't entered anything yet. What do I do, I tried to get what is the difference with form vars when submitted and when never submitted. I found out you can do this by form ID as it changes each time (which is not so good for theming of the forms). Somehow more convenient was to look at $vars['form']['#validated']) that is not present on the first load, so if it is not there I just do some custom actions
Theming whole modal form with custom class
In the previous post I wrote about the way to create custom modal form sizes. This time I will add a class to each window, so you can also theme them totally. Currently by default there are only generic classes and you can make one header of modal form different then the other. You can only theme form part as form element has unique class. As in former post I created
Creating custom forms for modal forms
If you want to create custom forms (custom window sizes) for modal forms, there is a hook in module that will let you define them. By default you have small, medium, large. This way you can create your own.
Use modal_forms_js_settings hook alter and just add data to $js_settings array
$js_settings['modal-popup-login'] = array(
'modalSize' => array(
'type' => variable_get('modal_forms_popup_extra_type', 'fixed'),
Change links section on User Login page
There is a good guide how to make custom login here https://www.drupal.org/node/350634
But to make some advanced changes I created this overrides. I repositioned the links below the submit button with deleting the array values and then adding it to the end of form array. Also I changed the text of the links to register and reset password
$items = array();
MAMP MySQL server doesn't start
If your mysql server won't start in MAMP you should run
sudo killall -9 mysqld
and this will probably make it run again.