Layout selector
The goal of this module is to take the ParsedTemplate data structure and turn it into the Template data structure.
We will later use this Template data to create the presentation.
ParsedTemplate vs Template
Section titled “ParsedTemplate vs Template”Here are the main differences between them:
- the
ParsedTemplateis only a temporary data structure that is not stored in the database - the
ParsedTemplateis closer to the original PowerPoint file, as it contains both slides and layouts - the
Templatedata is a trimmed version of theParsedTemplate, keeping only what is necessary for the presentation creation process - the
ParsedTemplatestill contains some PowerPoint internal values as-is (e.g. layout type), while theTemplatecontains only our internal representation of similar things (e.g. a PowerPoint placeholder typesubTitlebecomes our internalSUBTITLE)
Why is this needed?
Section titled “Why is this needed?”We could theoretically have included this directly as part of the file parser.
But we decided to separate them for multiple reasons:
- easier maintenance thanks to a reduced module scope
- we sometimes need the raw version of the template (e.g. previously, when we had a UI to configure custom templates, for internal template configuration validation purposes)
Layout selection
Section titled “Layout selection”As part of the mapping from ParsedTemplate to Template, this module also determines which layout from the original file can be used and in which case.
We experimented with multiple ways of doing this automatically, but we ended up relying on manual configuration made directly in the PowerPoint file.
The main way to configure this in the template file is through naming conventions, mainly applied to layouts and placeholders.
When creating the template file, the designer must follow a set of rules to make it compatible with the system, for example:
- naming a layout
SS_ITEMS_3will be interpreted by the system as a layout of typeITEMS, made for3items - naming a placeholder
SS_ITEM_1_TITLEwill be interpreted by the system as a placeholder for thetitleof thefirst item - …
More details about this can be found here.