Download & Extend

Can't assign author ID as context

Project:Chaos tool suite (ctools)
Version:7.x-1.2
Component:Page Manager
Category:support request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

I think Earl Miles is a genius. There, I said it.

I have been trying to create a block (View content pane) that shows News content written by the author of the node I am on. The node is Organic Group content. I can do it outside of OG with a regular old View block with a contextual filter that grabs the Author ID. But using Organic Groups and Panels, I have been unable to pass the Author ID as a context.

I have the content pane successfully filtering all of the News for the Group the node is in, but get stuck when I try to filter by the author of the node. In Views when I try to set the Argument Input it looks like this:

Content: Author uid source
From context
Required context...

Here is where I get hung up. I can select Node:Author but think I should be getting the Node:Author ID. And when I try to pass that in Page Manager I just don't have luck. This seems like it should be possible because it is such a common thing for a regular view, but I think I am missing some concept and could really use a point in the right direction.

Thanks!

Comments

#1

Hmm. You're not missing anything; Node: Author *should* be getting the author id, but it's possible that's not available as a token from the token system. It might be the author name. You might try that as a contextual filter instead?

#2

Thanks. Based on your comment I got it working. Awesome!! I added the "Content: Author" Relationship which exposed the "(author) User: Name" Contextual Filter and it works!

Which leaves me with the dilema of how to EXCLUDE the author of the current node from a view content pane. "(author) User: Name" does not have an Exclude button in Configure contextual filter. "Content: Author uid" DOES have an exclude button, but does not work to filter the View.

Thanks again!

#3

If you set the contextual filter to the User validator, you can set it to validate based on user name; However, doing so will convert it to a uid for you.

#4

Wow, that did it. Thanks. I used "Content: Author uid" as the contextual filter and set "Specify validation criteria" to "Only allow string usernames."

I really appreciate the quick response.

#5

Category:support request» bug report

It's still a bug if you can't just pass the UID, even if you can work around it like that. I'll have to look at the converter system and see why the uid isn't available. It really should be.

#6

Well. I suppose another workaround is to add the node author relationship so that you have a user context, and pass a user context instead of a node context. That, I'm sure, will have a uid available.

#7

Category:bug report» support request

Thanks a million!