1
votes

I want to make a view, that can show a single blog post. This is to be used in a panel.

Is it possible to create a view, that show a node getting the node id from the url?
I have tried creating a view with :

CONTEXTUAL FILTERS -> nodeid -> WHEN THE FILTER VALUE IS NOT AVAILABLE ->Provide default value -> Content ID From URL

This does not seem to work though, maybe the URL to the panel holding the view is constructed wrong?

1
Give us an example of the page path where are you trying to use "Content ID From URL".hugronaphor

1 Answers

0
votes

1) If the panel page is a node template override it will have no problems and it will work without extra settings (you will see that also when you set the panel pane, there are not extra settings).

2) If not (eg if it is a frontpage panel page) you have to pass the argument from panel to views. The path for that page should have a nid argument or a panel pane may have this. Eg your path may be "home/%node". And you have to add a context to your panel that is of type node. Then Assign the Node: id to this argument.

Panel page context settings

Panel pane views argument

See a similar discussion at https://drupal.stackexchange.com/questions/63538/how-to-pass-a-nid-to-panel-and-load-a-node-with-the-given-nid-as-context