Hi I am just getting into Panels for a client site.
I am using Panels and Panels Everywhere and Mini Panels along with the AT Panels Everywhere theme.
What is the basic difference between the "Default site template" (site_template) and "Node template" (node_view)?
It seems the same tools for creating layouts are available to both. One source says that the "node template" only relates to the usual content area of a node (and not the header, footer etc.) and yet there is a video series where the author uses only "node templates" with selection rules applied to custom content types. In this series mini-panels are used for the header.
I have created a home page layout using both methods and the HTML seems cleaner when using the site_template method but why have both? Is it a matter of using one or the other?
Cheers
Comments
Different templates, different concerns
When you are using Panels Everywhere you letting Panels take over the page rendering completely. The Default Site Template functions similarly to the page.tpl.php from themes of old. The site default template should contain the Page Content pane. This pane will display the primary page content which often times is a node.
The tools for use on the site template and the node template are similar, but a node template overrides just the display of the node elements. So when you are viewing a node page display the layout you have set in the node template will display inside of the default site template.
Image to try to illustrate: http://d.pr/i/azoP
So it isn't one or the other, but usually both.
Thanks for the image Jason,
Thanks for the image Jason, it helps. So if I had a Site Template variant that used a selection rule based on content type I can set the main content pane to use content from the node.
If I also had a node template variant which had a selection rule for the same content type, would the settings from that be used in the content area of the new page?
Is it a good practise to use the site template in conjunction with a node template? Since I have found if I set the main content in the site template to use node content , it seems all I have to do is create a new node from the content type?
Are there best practises for naming the IDs and classes for CSS especially when using the Builder approach?
Endless options
You can set a site template with selection rules, though in my experience this is less common than setting the selection rule on the content templates. In most cases a site has a global header, footer, etc… which is what I would typically put in the Site Template.
Then using selection rules provide an alternate content layout via node or term templates.
One thing to note so you don't end up with too many variant templates… you can set visibility rules on individual panes. So if you have a sidebar block that only shows on specific node types you can set visibility rule on the pane instead of building a completely separate Site Template.
Thanks Jason that makes
Thanks Jason that makes things much clearer. And thanks for the reference to the CSS coding standards; much appreciated.
Cheers!
Hi Noel (and Jason): Just
Hi Noel (and Jason):
Just FYI, for my business' D7 site I am using neither Panels Everywhere nor the corresponding AT theme.
I am using Page Manager, Panels and other components of that ecosystem pervasively, along with one of the commercial AT themes (Headliner). You may or may not find the result interesting. See https://luthierbuilt.net.
After looking at Panels Everywhere, I decided it was neither needed nor desirable for my site's needs.
Just another perspective. Obviously Jason has far more expertise with these matters than I do.
Best,
Bob
Thanks for the alternative
Thanks for the alternative perspective Bob. Much appreciated and good to know.
As a newbie to Panels it seems that Panels and associated modules such as Panels Everywher provide awesome flexibility and along with that different ways of solving the same problem.
There doesn't appear to be a "right way" or a "best practises" to use just different methods or workflows that suit particular users.
Cheers,
Noel