Closed (fixed)
Project:
Author Pane
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
18 Aug 2009 at 18:17 UTC
Updated:
15 Sep 2019 at 21:39 UTC
Jump to comment: Most recent
Comments
Comment #1
michelleThis isn't a bug; it's by design. It's meant to show on user/# only. I'll give some thought to whether there's a better way to do it that will be more flexible.
Michelle
Comment #2
abhishek sawant commentedHi,
I recheck it but still no result any help will be highly appreciated.
Comment #3
michelleI just said I'd give it some thought... Unless you have a magical computer than turns thoughts into code, rechecking it won't do any good. ;)
Michelle
Comment #4
clockwood commentedI just ran up against this myself and I'm curious if you've decided to tackle this or not ;)
My usage case:
I'm creating an image gallery, using views/panels to show user 'galleries' (all of a user's nodes) and I'm showing the Author Info in a block to the side. My paths are set up differently, and I can't change 'em at this point.
I don't know the dirty details, but maybe an option/override to use the block's php visibility logic?
btw - Thanks for this little gem :)
Comment #5
michelleI'm still going to do this. Just haven't gotten to it, yet. I haven't spent much time on my modules in the last couple of months. Hopefully I'll have more time for them soon.
Michelle
Comment #6
clockwood commentedI got it working for my needs, so I'll post what I did in case someone else wants to do something similar.
This code will show the author pane in a block on a non-user page. In my case a gallery (views) of all photos submitted by a user. The username is passed as a views argument, and the url is set up as: /gallery/username.
Then you can use author_pane.tpl.php to customize and style the output.
Comment #7
clockwood commentedWell, the above code -was- working until I upgraded to drupal 6.14. Now I'm getting some annoying errors:
It only happens when calling the author pane outside of /user.
This error appears often in search results, but from what I've seen it's possibly a problem with partial data being passed in the user object (ie, roles). I might be totally off though. Hope someone has some suggestions.
I'm doing some testing calling and presenting the referenced author directly from a block (not using author pane) and it seems to be working. Makes me think its an issue with the module (at least when used in this way).
I know Michelle isn't actively working on the module, but does anyone have suggestions?
updated testing
after some testing, it appears the problem is with trying to load the content profile data into the $account variable required by author pane. It's beyond my knowledge to dig into the module, so I'll likely have to theme a separate block template as a faux author pane.
Comment #8
Anonymous (not verified) commentedIn my case, what I want to to is prevent the Author Info from appearing on some pages. My solution is to disable the block entirely and re-create using Views :(.
Comment #9
michelle@Becky: It only appears on /user /blog and /node/N. If you don't want it to appear on some of those, just list those in the "show on all pages except" box. The problem in this issue is to have it show on /user and /user/N/somepage and not /user/N/edit. That gets trickier.
Michelle
Comment #10
michelleI changed it to specifically exclude /edit. Other paths can be excluded in the block visibility options as needed.
Michelle
Comment #12
drupalina commentedWell, thankfully, Author Pane provides 2 tpl files. So you can use author-pane-block for the standard Author Pane block, and then create another custom block, and use author-pane.tpl.php as it's template. All you need to enter in the body of that custom block is:
Like this you can display this block on a custom views page like user/*/friends (where normal AP block won't appear)
BUT....
You will need to do some modifications to the author-pane.tpl.php
Specifically, it will need to deduce the UID, usernamename and picture path from the url's arg (1)
I tried putting $account_id = arg(1) at the beginning of author-pane.tpl.php , but that got me only half way -- username and picture still don't load correctly.
Does anyone know what else do we need to write in a custom block or author-pane.tpl.php to make this work???
PS: author-pane is awesome!
Comment #13
michellePlease don't hijack closed issues for unrelated support requests.
To get the UID, use $account->uid.
If you need more help, please start your own issue to keep the issue queue organized.
Michelle
Comment #14
cbovard commentedHello,
I have encountered this issue and found a solution. I need the author pane block available on other pages.
In the author_pane.module file on line 237 I commented out this code:
Basically you can control the block visibility on the: /admin/build/block/configure/author_pane/0 page.
I hope this helps someone out.
Chris Bovard
www.chrisbovard.com
Comment #15
kent_drupal commentedI had modified author-pane.module to allow Author Pane block on all the pages. You can still control the pages from block settings. Here is the code:
Under function author_pane_get_block(), add following code:
1. comment:
/*if (!($area == 'user' || $area == 'node' || $area == 'blog') || !is_numeric(arg(1)) || arg(2) == 'edit') {
return;
} */
2. Under else case, comment
if (empty($allowed_types[$node->type]) condition
3. add following code:
// added below if case to allow AP on node/add/ pages as well
if($area == 'node' && arg(1) == 'add' && arg(2) == ''){
global $user;
$uid = $user->uid;
}
else{
$uid = $node->uid; // put it in else case.
}
This works for me Perfect !!!
Comment #16
avpadernoI am removing the tags used in just few issues. I apologize for bumping this issue.
Comment #17
michelleNo worries. Good to see the tag list getting a cleaning. Thanks for all you do to make this site better. :)