Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save badabingbreda/f1b3f65eb426f49e1f78e082cd8f22f6 to your computer and use it in GitHub Desktop.
Save badabingbreda/f1b3f65eb426f49e1f78e082cd8f22f6 to your computer and use it in GitHub Desktop.
Toolbox Docs: Plugin Development Alias Module by inclusion as a seperate twig template
<?php
/**
* Starter Plugin User Info Alias Module
* USER INFO
* @since 1.0
*/
\FLBuilder::register_module_alias( 'starter-user-info', array(
'module' => 'acftimber',
'name' => __( 'User Info', 'textdomain' ),
'description' => __( 'Starter User Info', 'textdomain' ),
'group' => __( 'Starter Plugin', 'textdomain' ),
'category' => __('User', 'textdomain'),
// path to a custom svg icon (20x20 pixels)
'icon' => TOOLBOXSTARTER_DIR . 'modules/user_info.svg',
'enabled' => true,
'settings' => array(
// Method 1: include the twig template using twig include, useful for future updates where all instances
// of this Alias Module require the same update. Plugin needs to remain installed and active.
'timber_template' => "{% include 'starter_user_info.twig' %}",
// OPTIONAL: settings_form_name. If your Module takes settings you can refer to the settings_form here. The form
// needs to be registered seperately.
'settings_form_name' => 'toolbox_starter_user_info_settings',
),
) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment