Hi, I created a mini panel intending to display some fields on the node it's going to appear on.

I added required context: node. And then created added some fields 'relating' if i may use that views term, to the context. I put it on my node, I don't see anything.

But if I add a node context on the right side of the UI, the non required context, I can select a specific node and get its fields displayed fine.

I want to display the fields of the current node being viewed. Am I incorrect in thinking that's what the required context does? Am I missing something? Thanks in advance!

Comments

merlinofchaos’s picture

I put it on my node, I don't see anything.

What do you mean 'put it on my node'? What did you actually do here?

ManyNancy’s picture

I used the block UI to set the mini panel on a sidebar and then went to a node page. I see the empty text, no content.

When I used a node context, the version with one node, I see the field content.

Thanks for the support.

merlinofchaos’s picture

Status: Active » Fixed

There are no contexts available in the block UI, so that won't work. In order to get a block that extracts context from a node, you'd need to use the CTools page manager, add a variant to the node_view page, and place your blocks that way.

The thing is, if you actually ahve a required context on your mini panel, it shouldn't even show up in the block UI because it requires a context that isn't available.

ManyNancy’s picture

Status: Fixed » Active

Is there no way to get the node context? In views you can just set the argument from the url.

I swear I do have a required node context, but it's definitely in my admin/build/block page.

I can't use the panels node view because of incompatibility with ajax comments.

http://drupal.org/node/672722

Thanks.

merlinofchaos’s picture

Status: Active » Fixed

There are no contexts available in the block UI.

ManyNancy’s picture

Status: Fixed » Active

Then where do I get the node context if there is no context available in the block UI?

merlinofchaos’s picture

Status: Active » Fixed

If using a mini panel as a block, you cannot. Please note that you have now effectively asked the same question 3 times, and the answer is that you can't do this. Trying to ask another way will not change the fact that contexts are not available in the block UI, it will only frustrate both of us.

Status: Fixed » Closed (fixed)

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

vinoth.3v’s picture

@merlinofchaos :

you are right if there is no context supplied.

I am using the Mini panels with required context + panel_teaser module.
I believe panel_teaser provides the context. But in php, it is empty.

nedjo’s picture

Component: Plugins - contexts » Code

A way to achieve the same aim might be:

* Create a node view
* Add a node nid argument and provide a default argument from the URL
* Add the node fields you want to display
* Create a views pane display
* For arguments in configuring the views pane display, leave at the default (none)
* Save the view
* Add the view to a mini-panel
* Display the mini-panel's block. E.g., using the Context module, display the mini-panel's block when viewing nodes of type X.

netw3rker’s picture

I just bumped into this too.

I'm curious why mini-panels went the route of not having the ability to derive context for its required contexts, but views did? As manyNancy points out, views with block displays have *the same context problem* with their contextual filters. but when a value cant be resolved (like when they are in a block) you have the option of saying "if it doesn't exist, get it from the url". I'm not sure why that isn't something that mini-panels should also do?

merlinofchaos’s picture

Views doesn't "derive context". Views has argument plugins that can fill in an argument based upon a URL.

Lots and lots and lots of people use views in blocks.

Very very few people use mini panels in blocks; that is not their primary purpose. Even when they do, they rarely require contexts. That is an even narrower purpose that very, very few people use.

It is possible to write context plugins that derive their context, if that is what you want. However, the demand is relatively low -- no one who is interested in such a thing has (that I know of) contributed something back.

Anonymous’s picture

Everything merlinofchaos is saying is correct.

However, #1621588: Pass page manager context to block mini panels is a patch that allows mini panels as blocks to grab context from the ctools page manager.