Fresh install of 4.7 beta5 -

I have an interest in the Author Information Block so I tried to incorporate it.
Here are my results:

First, the block never displays when viewing a users personal blog (page)
The only time I could get something to display is within a personal blog post (node)
My understanding was that this block should work on page templates as well as node templates.
If you are viewing a users blog, you should be able to see this block.

Within a personal blog post node, Intitial configurations to show the block failed to do so.... except using the 'content' and 'footer' block placement. Sidebars did not work. Later attempts did work in sidebar and I did not make any changes... so that was odd. It just suddenly appeared... after I was browsing the admin areas. Maybe the theme refreshed when I was in the theme admin.

I'm not sure how 'weight' works for the 'content' block section... Do blocks always appear below the actual content? I couldnt get it to show above.

Header block placement does not seem to work and their is no yellow signifier.

-

Comments

sulleleven’s picture

Category: bug » feature

Upon further review, it appears that the current profile module is not intended to work from a blog page template and only inside node templates. I think an earlier patch before it was added to head may have allowed for this but i have not tested it.

Regardless, i will change this to a feature request because i do not believe we should have to create a custom block using php code to achieve this. For consistency, I would like to see the Author Information block that is integrated with the core profile module become acessible from blog page templates, making a call to user id of blog.

If anyone can provide suggestion on how this can be best achieved, I'd appreciate it.
I've tried some hacking on profile.module but so far i cannot seem to grab user profile data from page template.

This is so basic and logical.... it should be implemented.

antarcticlemur’s picture

Title: Author Information Block » Author Information Block - fix to display on blogs
Version: 4.7.0-beta5 » 4.7.0-beta4
Category: feature » bug
Status: Active » Needs review

I think the following changes to profile.module fix this problem. The previous code was skipping the entire profile block display function if the 1st argument is not 'node' (its 'blog' for a blog page). This change looks for 'blog' in the arg(0) as well, and uses a different method for specifying the user ID if a blog is being viewed because $node->uid is not available.

I don't know how to make patches yet, so I'll just paste the code here for now. Stick this from line 76 in the profile.module included with Drupal v4.7 beta4:

<?php
        if ((   (arg(0) == 'node') || (arg(0) == 'blog')  ) && is_numeric(arg(1)) && (arg(2) == NULL)) {
          $node = node_load(arg(1));
          if (arg(0) == 'blog') { // Sets User ID if a blog is being viewed ('blog' identified from argument 0, ie sitename.com/blog/*).
            $userid = arg(1);
            $account = user_load(array('uid' => $userid));
          }
          else  { // Sets User ID if a node is being viewed (ie sitename.com/node/*)
            $account = user_load(array('uid' => $node->uid));
          } 
?>
Uwe Hermann’s picture

Version: 4.7.0-beta4 » 4.7.0
desm0n’s picture

Tried incorporating this at line 76 and got a php error.

Does this work for 4.7 final ? And if so where about exactly do i post it ?

A before after - insert here would be handy.

Uwe Hermann’s picture

Status: Needs review » Active

There's no patch.

magico’s picture

Version: 4.7.0 » x.y.z
Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)
jumoke’s picture

Version: x.y.z » 6.16

I am using Drupal 6. I need Author Information block to display on the Views that i have created for path blogs/%user and videos/%user.
How do i make this happen?