Tuesday 19 October 2010

Move user picture to a seperate tab in user profile tab menus

Normally if you go to user/%/edit there are all the user settings put together, which might be little confusing. I decided to move User Picture fieldset to a new tab, just to make it easier for users to upload their avatars.

To accomplish this you need to create a helper module, let's call it custom_module.
Now inside custom_module directory create two files custom_module.info and custom_module.module



Sunday 17 October 2010

Drupal views title block with clickable "more" link

Ok, so you have a block created in views with i.e. last 10 comments and you want to add link to the page with the rest of the comments. You can add standard "more" link in views which will be included under the block, but you saw on Facebook nice "more" link included in the block title.
----------------------------------
Title                more>
----------------------------------
Here I will show you how you can do it.

We will create a small module called 'Block "more" link', which will add new display to views.

Friday 15 October 2010

How to display a Node Gallery in a grid?

If you use Node Gallery module, you probably wonder how to display images  in a grid? It's very simple and you can do this with CSS below:

.gallery-images-list {
  overflow: hidden; /* clear floats */
}

.gallery-images-list li {
  float: left;
  width: 24%; /* you can adjust this to your theme */
  min-height: 190px; /* if you use long titles which will be displayed under pictures some pictures may 'stuck' and not go to left, try lower value and you will see what I mean */
}

.gallery-images-list .image-thumbnail a {
  display: block;
  text-align: center;
}

.gallery-images-list .image-thumbnail img {
  margin: 5px;
}


Simply paste that code at the bottom of your style.css file.

Interesting article about CSS, images and grids click

Wednesday 13 October 2010

Disable OPML link/icon [Organic Groups]

There is a couple of ways removing this annoying OPML link and icon seen on the My Groups tab.

1. Use CSS, add in your style sheet:

.opml-icon {
  display:none;
}

2. Edit view and under 'Basic Setting' for Header or Footer insert:
<p></p> or <span></span> or any other html tags

3. Override theme_opml_icon() function in theme's template.php file:

function YOURTHEME_opml_icon($url) {
  return '';
}


All of these will work, but definitely number 3 is recommended solution, simple & that's how it should be done in Drupal.