Templates
The sidebar code is generated from Webflow and exported as a Zip.
We do some conversions in the process.
The sidebar code integrated with the HTML using custom attributes to identify and manipulate elements.
Feature Groups Functionality
Represented as tabs
TBD how we'll tag and hide-show these.
Consider SPA approach, merging all tabs into a single page.
Tab acts as a filter for feature-group
Set the page info and mode at the background-worker level
Remember it at the background-worker level
Query it from the tab-level code to get what's needed
feature-group = ( name )
Feature Functionality
Used to enable relevant features for a given context.
feature = ( name )
Classes;
FeatureHandlerBase
show/hide
FeatureHandler
: FeatureHandlerBase
Init - clears item-groups
AddItem - finds the item-group, creates a template, callback to populate
Layout Item-Group Functionality
Exists within a feature as a place for items
? change to
item-group
layout = ( name )
To the Feature handler,
Finds item-template, matching ( name )
Item-Template Functionality
Finds, clones, passes back for modification, appends
Create elements from a pre-existing HTML template
Clones, modifies, and inserts them
template = ( name )
template-part = ( name )
Code is expected to know how to deal with that part.
Todo;
Callback modifications, arrow functions, inline code.
Methods;
SetSwitch - only applies if it happens to be a switch element, fail gracefully
Callback, passes item handler object, element, template-part name, specific element
Switch Functionality
Modelled after switch/case logic.
Used to display one of a set of choices in the template, such as an icon.
template-switch = ( name )
template-case = ( case item )
Flow
Determine context
Reset everything
Normalize tabs
Disable all features
Set main data, e.g.
page title
indicators on webflow / non-webflow
Enable Tabs / Feature Groups
Enable Relevant Features
Initialize. callback function
`
Last updated