Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Developer Info To Custom Elements #1

Open
InoPlugs opened this issue Jan 28, 2021 · 0 comments
Open

Developer Info To Custom Elements #1

InoPlugs opened this issue Jan 28, 2021 · 0 comments

Comments

@InoPlugs
Copy link
Member

InoPlugs commented Jan 28, 2021

Custom Element Templates (CET)

  • A CET is based on the shortcode of a single ALB element
  • Additional attributes are added that store, if the value of a setting is locked
  • A locked value will override any setting set in the ALB element using this template when rendering the shortcode. The original values in the shortcode of the ALB element is never changed.
  • Hierarchical CET are supported, means it is possible to use a CET as a base and this CET can be based on another one..... Locked values are evaluated bottom up ( CET 1 -> CET 2 based on 1 -> elment based on 2 ), the first locked value is used
  • It is always possible to change to a CET as a base or back to "no base". When switching to a CET most values of this CET are copied ('tmpl_set_default' !== false). When switching back to base the attribute values remain unchanged.
  • Modal Group Subitems also support CET

Internal Management of CET

  • The shortcode of a CET is stored in a CPT post having a unique DB ID ($post->ID) and term is the shortcode ( see aviaElementTemplates::updated_post_content() ).
  • A CET for a "Modal Group Subitem" is embedded in the outer shortcode and is identified by attribute select_element_template='item'
  • If the settings "All subitem use the same CET" is used attribute one_element_template='xxx' in the outer shortcode contains the ID of the subitem CET and the CET is created automatically when a new element is created.

Shortcode buttons ALB and CET and shortcodes in canvas ( ALB page editing section )

  • ALB shortcode buttons add the default shortcode attribute values to the canvas
  • CET shortcode buttons use the last saved attribute values for this CET. After adding it to canvas the element is treated as a normal ALB element based on the CET (identified via ID: e.g. element_template='3258')

Modal Popup when editing a page

  • Values of locked elements can be displayed but cannot be changed and show the locked value of the CET - which will be used when rendering the shortcode. The real set value is still kept and NOT changed.
  • Preview window in modal popup already makes use of the locked values
  • It is always possible to change the base to a CET or back to base shortcode. The values of the settings of the ALB element (or a former CET) are NOT changed when switching. This allows to switch the base without loosing your already made settings.
@InoPlugs InoPlugs changed the title Integration of Custom Elements Developper Info To Custom Elements Jan 28, 2021
@InoPlugs InoPlugs changed the title Developper Info To Custom Elements Developer Info To Custom Elements Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant