Partials are HTML documents that contain only a part of the whole page, for example a widget, or in this case the content of various Pinegrow Web Editor dialog windows.
In Pinegrow we use partials for editing dialog boxes.
Take a look at Open as partial… dialog box:
Instead of hard coding the layout of the dialog in the code, we have a special HTML file where this and similar dialogs are defined. This makes it super easy to edit them with Pinegrow:
With the help of Save partial action we than export each dialog to its HTML partial file (the file contains just the HTML code of the dialog). For example, we export the Open as partial dialog into open-partial.html file:
Then in the code that creates the dialog we just use a simple function that loads the partial through Ajax call and use the returned HTML to construct the dialog box:
And that’s it!
Of course, you would need to define your own function for loading the partial into your app. It can be a simple Ajax get call.
Last updated on February 14, 2017 at 9:03 pm