Ad

How To Display Partial Only On A Page And Its Subpages? OctoberCMS

- 1 answer

Hello!

How to display partial only on a page and its subpages? How to build a condition correctly?

how to display the menu on "about company" and its subpages
.../about-company
.../about-company/history
.../about-company/something-else
I know what can be done to the condition for one page

if this.page.id

and how to do for all subsequent subpages –

Ad

Answer

You would typically do this using layouts like Pettis Brandon suggested in the comments.

You seem to be under the impression that this would require duplicate code. It does not. You would place any duplicate code (code that remains the same in multiple Layouts) in partials. Different Layouts would simply include the same partials.

Ad
source: stackoverflow.com
Ad