Expose current user as context/pass current user as argument into panel

H3x - August 9, 2009 - 22:07
Project:Chaos tool suite
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

I want to expose the current user as a context, i.e. automatically pass the current user as an argument into a panel so that it can be passed from there into my respective views. I've searched everywhere I could think of, but am unable to find any solution to my problem. Am I missing something simple?

Please note: I'm NOT trying to limit access to panels/variants, but even if I did want to, this still would not solve my problem of passing the current user as an argument into a panel.

I tried using combinations of 'me' alias, URL alias and a manual menu entry (after temporarily hacking out the menu validation) to 'path/me' (where the panel path is 'path/%user') but I get a "Page not found." error.

The closest I've come to a solution is using PHP to pass an argument into the views referenced by the panel, but this is clumsy (it corrects the problem downstream and kind of defeats the purpose of having contexts in the first place) and does not work for all my panes/views. Furthermore it requires significant duplication of some views AND panels, seeing as I want to be able to pass ANY user (incl. the current one) as an argument into a view. If I use the PHP argument method, I would need to duplicate all these views (have one with a normal argument and one where the argument is automatically passed) and have seoarate panel variants. Like I said: that kind of defeats the point of having contexts.

I've noticed that "logged in user" is exposed in the Access subsystem, but not in the Context subsystem. Would it be easy to port? Alternatively, what about allowing PHP-arguments in panels?

Does anyone have any advice? I desperately need this feature and have all but given up. This is quite a significant absent feature IMHO.

#1

H3x - August 9, 2009 - 22:07
Title:Expose current user as context» Expose current user as context/pass current user as argument into panel

#2

merlinofchaos - August 9, 2009 - 23:11

I've been thinking that current user needs to be an automatic context on all pages, not just in the access system, so will try to work on this at some point.

#3

H3x - August 10, 2009 - 00:17

Your effort will be HIGHLY appreciated. Any guess as to a time frame? Or any else willing to work on this as well?

#4

merlinofchaos - August 10, 2009 - 02:58

I don't think I'll get to it before the full release.

#5

szadok - August 18, 2009 - 14:30

When is the full release scheduled?

#6

Manuel Garcia - August 26, 2009 - 12:00
Version:6.x-3.0-rc1» 6.x-3.x-dev

Deffinetly would be nice to have this. It would greatly increase the possibilities... think switching the frontpage for logged in users based on their information...

anxious to test anything that comes up here!

#7

sagannotcarl - November 4, 2009 - 08:51

I agree this would be great.

I also would be happy to test this as I have a couple places I've wanted this and could try it out.

#8

sdboyer - November 5, 2009 - 23:51
Project:Panels» Chaos tool suite
Version:6.x-3.x-dev» 6.x-1.x-dev
Component:Plugins - contexts» Code

This request has been made in the CTools queue as well (which is where it properly belongs), but this is longer/older, so marking that one duplicate.

#9

crea - November 25, 2009 - 05:30

Subscribing

#10

michi20 - November 27, 2009 - 12:00

Subscribing

 
 

Drupal is a registered trademark of Dries Buytaert.