Turning components into partials to be able to reuse them on different pages in your application.
After reading this article you’ll know how to:
-
Turn the navigation bar component into the header partial
-
Reuse the partial on another page
-
Auto-generate partials while setting up a new page
Partial is a part of your application’s page comprising one or multiple components. Creating partials is essential for those citizen developers who want their web applications to have the same components and functionality on various application pages. Usually, these components will be the header and footer of the page. In this article, we will go through the way of turning the navigation bar (header) into the partial, and then we will reuse it. Also, you are going to find out how to auto-generate partials while setting up a new page.
Learn more about partials by watching a video:
Creating partial
|
Reusing and editing partial
In this part, we will reuse the header partial we’ve just created on another page in the application.
|
Of course, you can always edit your partial, but mind that changes will apply to all the pages you’ve used this partial on.
Click once on the partial. In the sidebar menu, choose the |
Also, it’s possible to turn the partial back into the regular component. To do this, come back to the partial options and choose the |
One more way of reusing partials is during setting up a new page. Let’s try this in practice.
|
Auto generating partials
Last but not least use case we are going to walk through is auto generating the top menu and footer partials. This function might appeal to those who want to quickly create the default header and footer for their application and then later edit them.
|
|