Build Your Own Business Website header image

Box Inheritance & Persistence

Difficulty Level -

Filed Under Topics - , ,

Listed Under Lesson Subjects -

Applies to -

Whoops, you've found some protected content!

Watch the opening clip of this video to preview it,
the full video is available to free and paid members.

The next thing I want to talk about is Box inheritance and Box persistence. There was a question asked about this in a former session and it’s an important thing to understand.

Box Options Persist Across Templates

Let’s look at the nav menu for an example. Everywhere you place this nav menu, the class of menu and this output control and this menu control text will be the same. Not only is that the case but so are the box options.

Every single place this menu is, it’s going to be that way. Let’s go to the Archive template and find the nav menu. Now let’s use the main menu. So now let’s go look at our Full Page template, lo and behold now this template is using the main menu. That’s because every template is using this nav menu box.

Chris: What he’s showing is the box properties. Those are the boxes properties no matter where that box exists. So if you change those properties in one location, you are just changing that box. You just happen to be changing it by editing the template.

Box Placement Doesn’t Persist Across Templates

Rick: However, its placement doesn’t persist. If you move the nav menu in this template, it’s not going to change or persist across all other templates with one exception.

Parent-Child Relationship Exception

That exception is if you are in a parent template and you make the position change there, then all the children templates will have that change as well.

Customizing a Child Template Breaks that Relationship

Chris: That is only if those child templates have not been detached from the parent by customizing it. If you make a customization to a child template it will not get overwritten by the parent.

Rick: Any customization that you do to the child template breaks the inheritance of the parent template. But before you do that you can change all of the child templates by moving a box around.

However, moving it in the Full Page template will have no effect on the Home template, Single template, the Archive template or any other template. So that’s one thing that doesn’t persist.

Contents of the Box Do Not Persist Across Templates

Another thing that doesn’t persist is the contents of the template. For example, let’s look at our Archive post box. Open Archive inside its post box there is a headline area and inside of that are these two boxes and then you’ve got the byline with those boxes and then you’ve got this. This arrangement like this.

Well, if we go to another template and we grab the Archive post box. You’ll notice it doesn’t look anything like that. It’s not keeping any of those contents or the arrangement of those contents because the contents and the arrangement of the contents doesn’t persist from template to template.

You may be changing a template and expect that you got rid of say, the author in all of your other templates but you didn’t necessarily because moving the arrangement, removing and adding these does not affect any other template. It just affects the template that you are in, unless of course you’ve got the parent-child relationship in which case it’s still in tact.

The options or the settings persist but the arrangement and the contents do not.

Chris: If it’s the position of a box that you are dealing with and you want to change the position of something, that position is always relative to the template. And then the setting, like going into the gear icon, that is universal. That’s relative to the box. But any positional stuff is only relative to the template and therefore is only going to be relative to that particular template.

0 Comments… add one
0 comments… add one

Leave a Comment