How to use the wagtail.core.hooks.register function in wagtail

To help you get started, we’ve selected a few wagtail examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wagtail / wagtail / wagtail / embeds / wagtail_hooks.py View on Github external
@hooks.register('register_admin_urls')
def register_admin_urls():
    return [
        url(r'^embeds/', include(urls, namespace='wagtailembeds')),
    ]
github vixdigital / wagtail-readinglevel / wagtailreadinglevel / wagtail_hooks.py View on Github external
@hooks.register('insert_editor_js')
def editor_js():
    """ Adds additional JavaScript files or code snippets to the page editor. """
    js_files = ['hallo-readinglevel-plugin.js','draftail-readinglevel-plugin.js']
    js_includes = format_html_join('\n', '',
        ((settings.STATIC_URL, filename) for filename in js_files)
    )
    return js_includes + format_html(
        """
github wagtail / wagtail / wagtail / admin / wagtail_hooks.py View on Github external
@hooks.register('register_account_menu_item')
def register_account_notification_preferences(request):
    user_perms = UserPagePermissionsProxy(request.user)
    if user_perms.can_edit_pages() or user_perms.can_publish_pages():
        return {
            'url': reverse('wagtailadmin_account_notification_preferences'),
            'label': _('Notification preferences'),
            'help_text': _('Choose which email notifications to receive.'),
        }
github neon-jungle / wagtailvideos / wagtailvideos / wagtail_hooks.py View on Github external
@hooks.register('register_group_permission_panel')
def register_video_permissions_panel():
    return GroupVideoPermissionFormSet
github torchbox / wagtailmedia / wagtailmedia / wagtail_hooks.py View on Github external
@hooks.register('insert_editor_js')
def editor_js():
    js_files = [
        static('wagtailmedia/js/media-chooser.js'),
    ]
    js_includes = format_html_join(
        '\n', '',
        ((filename, ) for filename in js_files)
    )
    return js_includes + format_html(
        """
        
        """,
        reverse('wagtailmedia:chooser')
    )
github wagtail / wagtail / wagtail / sites / wagtail_hooks.py View on Github external
@hooks.register('register_permissions')
def register_permissions():
    return Permission.objects.filter(content_type__app_label='wagtailcore',
                                     codename__in=['add_site', 'change_site', 'delete_site'])
github wagtail / wagtail / wagtail / contrib / modeladmin / options.py View on Github external
            @hooks.register('construct_explorer_page_queryset')
            def construct_explorer_page_queryset(parent_page, queryset, request):
                return self.modify_explorer_page_queryset(
                    parent_page, queryset, request)
github wagtail / wagtail / wagtail / contrib / styleguide / wagtail_hooks.py View on Github external
@hooks.register('register_settings_menu_item')
def register_styleguide_menu_item():
    return MenuItem(
        _('Styleguide'),
        reverse('wagtailstyleguide'),
        classnames='icon icon-image',
        order=1000
    )
github wagtail / wagtailtrans / src / wagtailtrans / wagtail_hooks.py View on Github external
    @hooks.register('insert_global_admin_js')
    def global_admin_js():
        return format_html(
            ''.format(
                path=static('wagtailtrans/js/site_languages_editor.js'))
        )
github wagtail / wagtail / wagtail / contrib / forms / wagtail_hooks.py View on Github external
@hooks.register('register_admin_menu_item')
def register_forms_menu_item():
    return FormsMenuItem(
        _('Forms'), reverse('wagtailforms:index'),
        name='forms', classnames='icon icon-form', order=700
    )