0

Maybe I'm not getting this but for Page manager (Panels) there is two options to create a page either Custom Page or use the System (Node Template).

I need to create a Panel for the news page (/news). I could either create a Custom one and set the path to "/news" OR use the System node_view page and create a Variant where if the Selection rule = This panel will be selected if Current path is "news".

Which way is better? Should I overload the System with many variants where one of them checks if the Current path is "news" or create my own Custom Page for the news page?

enter image description here

3
  • I can't tell you which is better, but if /news is a node, then it's probably easier to override the system node template. Also you should use the real path instead of path alias when defining a selection rule, meaning node/XXX instead of news
    – Beebee
    Commented Dec 11, 2014 at 17:16
  • In the vast majority of cases, you should not have variants based on the URL, but on the content type.
    – Letharion
    Commented Dec 11, 2014 at 17:26
  • You will only override a system path if you want to change the default behaviour of the path (routing or display), and normally only for a specific context attached to the entity on that path (example: showing an enhanced 'article' to 'editors'). Commented Dec 11, 2014 at 17:28

2 Answers 2

0

A page provides a certain context.

For node_view, it happens to be a node.

There's no benefit to creating a custom page just to provide the same context.

You'd want to add a new page however, if you, for example, wanted both a node and a taxonomy term as context.

0

It's not a matter of which one is better, but what you are trying to achieve.

  • If you want to change what the system does when people view a node /node/%node, then you need to make a variant on that system page.

  • If you want to make a new page that does something different like /news then you need a custom page.

Each page listed in Page Manager must have a different URL, each variant within a page will have the same URL (except for arguments %mandatory and !optional).

So you actually cannot have a variant for news inside the node/%node system page.


One of the most common uses for a custom page is to display a view, which is what I assume your /news page to be.

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.