Drupal Dump

Drupal Snippets, Hacks and more....

495 posts since 2011

Advanced modal forms - modal windows with CTools (singe and multistep)

So I client of mine wanted to use popups :) but not just ordinary popups, he wanted to put there, login, registration, node adding, notificiations, user invites for OG, simple menus and even FB login and registration. We also needed to save some user choices before the login/registration and act upon them after the user logs in.

Views and custom dynamic titles for pages set with fields values or anything else

By default you can't set dynamic titles for views other than using contextual filters and using them to change title, this will sometimes help and sometimes you want to use something else, so custom modules/overrides to the rescue. There is also a page title module but you can use tokens with it and seems it doesnt work now.

Insert something every nth row in Views

Most likely you will want to insert an ADD, probably adsense add every nth row in views. To do that there are 3 methods. One of them is a module a guy made that acts as global filed you add and then you enter what goes in there, problem is that JS code doesnt work there as it is html only field, so some custom formatters should be added.

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.

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.