You are hereUser interface
User interface
JQuery, Javascript and CSS tips, tricks and hacks
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:
if (!empty($entity->field_collegamento)){
foreach ($entity->field_collegamento['und'] as $key => $value) {
Adding tracking (google analytics event) to phone numbers/phone calls
I wanted to have phone call tracking on my website, so I know how many users did click phone number to call over cell phone or phablet or whatever device they can call (maybe google glass or something) So I added some code to my phone fields. I have cck field that I display over display suite, so I override this field and remove default display and create custom display, code field where I use entity data and add custom code to the phone numbers so they are clickable links. Code looks like this
if (!empty($entity->field_phone)){
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. So I as there is no path translation I made URL alias on English, then made new menu item, just for English and there I have new URL that goes to my Panel but shows right URL in address bar.
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
$body_classes[] = (arg(0) == 'forum') ? 'forum' : ''; // Forum page
}
I add this two
$body_classes[] = (arg(2) == 'edit') ? 'node-edit' : '';
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
<h3><?php print $title; ?></h3>
<?php endif; ?>
<?php if ($title != t(History)) : ?>
<dl<?php print $attributes; ?>>
<?php print $profile_items; ?>
</dl>
Lightbox or Colorbox
Lightbox or Colorbox. I would say colorbox, its successor to thickbox, which i always liked, its smarter and just feels better. Maybe Lightbox has more features, but i see its missing one i really need and like, which is "Per post gallery" so all images on the post/page can be looked at with modal view(that black screen that goes over the content) continuous. Also it has option for login screen and has better looking default theme.
CKEditor and IMCE file button
You installed your CKEditor and IMCE but there is only image dialogue on your node edit screen and you want to add plain file link.
Fastest way to edit files, change CSS etc
Fastest way i found to make small changes on your site is to use FTP program like FileZilla. Then you just go to file you want to edit and click view/edit. File is downloaded locally and opened in your default (or the one you set in FileZilla) editor. Then you just change what is needed and after all is done just confim on FileZilla that you want to upload changes.
Lightbox2, hiding flash content
Having problem with Flash when using lightbox for overlay? Just add transparency to those flash embed codes and they will be in the dark.
<EMBED src="swf.swf" quality=best bgcolor=#FFFFFF wmode="transparent" WIDTH="550" ...