It would be great if CTools would allow you to create a custom string context in the UI. The current implementation has a "no ui" value set, but why can't we allow that to be set? There are a number of neat use cases you might want to add a custom context.

Files: 
CommentFileSizeAuthor
#7 ctools.code_.1774434-7.patch1.49 KBAngry Dan
PASSED: [[SimpleTest]]: [MySQL] 121 pass(es).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new782 bytes
PASSED: [[SimpleTest]]: [MySQL] 67 pass(es).
[ View ]

Here is a patch that changes the module!

Status:Needs review» Fixed

Huh. I have no idea why string contexts were never allowed in the UI. Maybe just in the early evolution of the system they didn't seem at all useful.

The use case that I found this most helpful was when I wanted to restrict certain content types to certain panel pages. This was really helpful in the context of making "administration" Panels because each panel page could be given a string context (i.e. "panopoly_admin") and then each content type that corresponds to administration can require that context. This is cool because then the admin content types *only* show up on admin panel pages since they require said context.

Hmm. I'm not sure string contexts are really what you want, there. You can't require specific strings for the content to show up, only that a string context exists.

I think you actually want specific types of contexts that correlate exactly to specific types of contexts.

So a "panopoly admin" context which can then be added to pages to say "Hey this is a panopoly admin page" and the like. A built in page task could then provide the basic panopoly admin page with that context baked in pretty easily.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Status:Closed (fixed)» Needs review
StatusFileSize
new1.73 KB
PASSED: [[SimpleTest]]: [MySQL] 121 pass(es).
[ View ]

It seems the committed patch allows defining a string context but the value can not be set there which makes this useless for site builders in panels ui.

This patch fixes it.

(Note: we might want to do the same for token.)

StatusFileSize
new531 bytes
new1.49 KB
PASSED: [[SimpleTest]]: [MySQL] 121 pass(es).
[ View ]

#6 thanks for this patch it solved a problem for me - I needed to be able to pass a string from a panel to a mini panel and then on to a view. The only way to do this is via a string context on the base panel because mini panels (unlike views) doesn't allow you to input contexts as strings.

There is a small bug introduced in the patch, if you add a string argument to your panel then you'll get all kinds of trouble because of the check on $data['string'] where the bit of ctools that converts an argument into a context passes $data as a raw string.

See attached patch for a fix which keeps things backwards compatible.

Thanks. This patch was useful when I tried to pass "all" string to views to bypass some arguments.

Category:Feature request» Bug report
Issue summary:View changes
Status:Needs review» Reviewed & tested by the community

The last patch applies cleanly and fixes the issue.
Reclassifying as bug.