Skip to main content

A Block for wagtail that lets users choose a Page/Document/URL/email/etc. as a link

Project description

A link block to use as part of other StructBlocks which lets the user choose a link either to a Page, Document, external URL, Email, telephone or anchor within the current page and whether or not they want the link to open in a new window.

It hides the unused fields, making the admin clearer and less cluttered.


To install:

$ pip install wagtail-link-block

Edit your Django project’s settings module, and add the application to INSTALLED_APPS:

    # ...
    # ...

To use in a block

from wagtail_link_block.blocks import LinkBlock

class MyButton(StructBlock):
    text = CharBlock()
    link = LinkBlock()

    class Meta:
        template = "blocks/my_button_block.html"

And the blocks/my_button_block.html

<a href="{{ }}" {% if %}target="_blank"{% endif %}>{{ self.text }}</a>


We’re using black, isort & flake8 for formatting & linting, and there are poetry commands in the Makefile for building, etc.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wagtail_link_block-0.1.6.tar.gz (6.3 kB view hashes)

Uploaded source

Built Distribution

wagtail_link_block-0.1.6-py3-none-any.whl (8.4 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page