2

I have 2 views with contextual filter, they work well stand alone.

Now I want to include those two views into a panel (called eg. trypane/ ) and pass to it the contextual filter for the views it includes (eg. 19)

So I create a new content, panel, and i've added those two views. But when i call the panel (trypane/19) simply it doesn't work.

The infos for the views included are:

Using display Master.
1 items displayed.
Without pager.
Sending arguments.
Using arguments: %2 

and a similar description for the second.

What's wrong with my setup?

1 Answer 1

2

You should create a views display of type "Content pane".

Then ideally configure it to take arguments from context, and specify that the view requires a node id (or whatever you actually need). This will make the view much smarter, for example allowing Panels to hide the view from the UI all together when on a non node page.

Then add the new content panes to the page. You should be asked for which node you want to use as the source for the nid. Usually there will only be one, and you can continue without changing any settings.

And your view will now show up.

4
  • ok i've created a new display for the view, and i've configured the Argument input to "from context". but when i've set up the panel i couldn't choose that display, it shows me only master, page and block
    – LorisNP
    Commented Nov 5, 2012 at 14:08
  • As I said, that's actually one of the advantages of using content panes, they only show up when they can be meaningfully used. If the pane doesn't show up, then you have a mismatch in what contexts that are available from the page, and what the view is configured to require.
    – Letharion
    Commented Nov 5, 2012 at 14:43
  • to be clear, the views are lists of entity, and they need the entity id to perform the query... so my panel, that include those views, had to pass the id specified in the url to the views. you say "you have a mismatch in what contexts that are available from the page, and what the view is configured to require".. so where i set the available contexts for my panel??
    – LorisNP
    Commented Nov 5, 2012 at 15:49
  • Where you control contexts depends on what the source is for the context. In your case, it you have a URL argument, so add a %entity_type part to the pages URL. When the page gets saved, an "arguments" tab will show up, allowing you to map the number in the URL to an entity object.
    – Letharion
    Commented Nov 5, 2012 at 17:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.