One of the most-requested features for the Gantry Framework across platforms has been for a more comprehensive inheritance system. Our team has been hard at work developing what we believe is the best solution for inheritance, and that work is nearly complete.
Let's start by talking a bit about what inheritance is, and why this feature is so important to the future of Gantry. Inheritance cuts down on development time considerably as it enables you to quickly select sections, and even individual particles, from one outline and apply them to one or more others.
So, let's say you have a footer arranged exactly the way you want it to appear on every other outline aside from your home page. Traditionally, you would set it up on one outline then duplicate that outline and customize it from there.
But, that causes issues in cases where your footer changes come after all the hard work has been put in on other outlines. This isn't an ideal solution.
So, we've created an inheritance system that lets you choose a section from another outline on the fly, and pull its settings and particles directly into your current outline. So, let's say your About Us page has a really great sidebar.
By selecting the settings cogwheel () for a specific section, the settings popup will appear, and in it a new Inheritance tab. This tab contains two sections, Outline and Include.
The Outline settings enables you to select an outline to inherit properties from for that section. For example, if you are in an outline dedicated to an About Us page, and you wanted to inherit the Header section from the Contact Us page, you would do the following:
- Navigate to the outline you are using for the About Us page.
- Select the settings cogwheel () section you wish to inherit properties to.
- Switch to the Inheritance tab.
- Select the Contact Us page's outline in the Outline dropdown.
- Toggle Section Attributes to receive section settings from the original outline, including the Layout, CSS Classes, and Tag Attributes.
- Toggle Section Children to inherit any particles that appear within the inherited section.
- Save your changes.
This is one example of how inheritance can work for sections. We are also working on adding inheritance for individual particles, and will share information on how this is done once we have it available.
Want to try the new inheritance system out for yourself? Once this feature is in a more completed state, we will merge it into our development branch so you can test it out. Stay tuned to our Twitter page for the latest information on development as it continues.