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

Workflow for adding new modules #35

Open
ghost opened this issue Jun 18, 2018 · 0 comments
Open

Workflow for adding new modules #35

ghost opened this issue Jun 18, 2018 · 0 comments
Labels

Comments

@ghost
Copy link

ghost commented Jun 18, 2018

Adding a new modules requires to modify several files in the code.

General idea

  1. register a module in php => the registered params will be used both when customizing and on front end
  2. register a module in js => to motorize the ui when customizing
  3. create a php template file => for the rendering on front and when customizing

Files to add / modify as of June 2018

  • inc/sektions/_dev_php/module_registration/4_0_0_sek_register_modules_after_setup_theme_50.php => this is where we declare the php functions in charge of loading the modules registration params + the module is registered
  • inc/sektions/_dev_php/module_registration/front/4_1_0_sek_register_{module_name}.php => the file in which the registration callback has to be declared.
  • assets/czr/sek/js/_dev_control/modules/front/_9_1_9_FRONT_{module_name}.js => the file where the customizer module can be registered to the api.czrModuleMap
  • inc/sektions/_dev_php/input_tmpl/3_0_1_sek_input_tmpl_module_picker.php => this is where we add new modules so they are draggable when customizing
  • tmpl/modules/{module_name}_tmpl.php => this is where all modules rendering php templates are located. Used both on front end when customizing and when published. The template path is declared as a param when registering the module in php.
  • __grunt-tasks-config__/concat.js => the concatenated files have to be updated with the newly added files

When the module needs specific localized params, like a list of options for a select input for example, or a translation string :

  • inc/sektions/_dev_php/1_0_0_sektions_customizer_assets.php => can be used to register localized params for the modules

Example

The heading module => 8a90aca

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants