2

I am writing my custom node--blog.tpl.php for my Drupal7 based site. I want to print the author image of the blog so in my tpl file i include the following:

$user = user_load($user->uid);
  print theme_image_style(
                array(

                    'path' => $user->picture->uri,
                    'attributes' => array(
                        'class' => 'in-blog-user'
                    )
                )
            );

However, it does not display any image and i get a error as :

The requested page "/sites/default/files/styles//public" could not be found

What am i doing wrong?

Regards

PS: my pictures directory is "pictures"

2 Answers 2

3

The following lines did it:

$user = user_load($uid);
print theme('user_picture', array('account' =>$user));
1
  • 3
    Please don't add follow up questions in the answers, if you have another question please ask it separately
    – Clive
    Commented Mar 12, 2013 at 10:10
0

There is Author Pane

Author Pane is a block of information about a given user, like those typically found on a forum post, but can be used in other places as well. From core, it collects the user picture, name, join date, online status, contact link, and profile information. In addition, any module or theme can feed it more information via the preprocess system. All of this information is then gathered and displayed using a template file.

For the tabbed view you cold try Quick Tabs

The Quick Tabs module allows you to create blocks of tabbed content, specifically views, blocks, nodes* and other quicktabs*.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.