JQuery, Javascript and CSS tips, tricks and hacks

Can't find a string to translate in drupal

This is kind of odd solution as it will confuse people.

"The t() function, to save on performance for single-language sites, won't store the string in the database until it is requested from another language. View the page in one of the non-default languages in order to populate the database (t() calls locale() to do this), thus making the string available for translation."

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.

Add UTM tag to links, so other people know when users come from your site

So this is some marketing stuff I do, but it is useful. When you click a link on some site, to give some message to that site and owner or whoevere is taking care of marketing you can add some UTM tags to links so in their google analytics they see that message. So what do we do is I use display suite, create custom code field and use entity data to make new fields that look like this:

Translating paths

I have got this panel, that has the same content for both English and Croatian. But I want to have custom path for each of them, so that address bar doesn't say something on Croatian when user interface is in English.

Authoring information and permissions

User 1 has all the privilegies. But for other you need to set them. If you want that user has ability to change who authored node you will need to give him "administer nodes" permission. Usually overlooked, this permission is unde node module permission set.

Fusion theme classes for node add and node edit pages

I almost always use Fusion theme as my base theme, one thing its missing and developers of it seem not to care is a class that is in body and is different for node add and node edit pages, so I usually go to template.php and around line 64, after

Hiding History in User profile view

This option of showing user history seems more obsolite then useful, se lets hide it.

For Drupal 6, copy this file from your /sites/modules/user directory:
user-profile-category.tpl.php, put the copy into your custom theme directory and within that file, replace the code with this