A Block for Wagtail that lets users choose a Page/Document/URL/email/etc. as a link
Project description
Wagtail Link Block
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.
Installation
Using pip:
$ pip install wagtail-link-block
Edit your Django project's settings module, and add the application to INSTALLED_APPS:
INSTALLED_APPS = [
# ...
"wagtail_link_block",
# ...
]
Usage
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 create the template blocks/my_button_block.html:
<a href="{{ self.link.get_url }}" {% if self.link.new_window %}target="_blank" rel="noopener noreferrer"{% endif %}>
{{ self.text }}
</a>
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wagtail_link_block-1.2.tar.gz.
File metadata
- Download URL: wagtail_link_block-1.2.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0ae53801f46cd90cb9f176ea3af4ae96e0dbb029b6942e1af8561e432219ecd
|
|
| MD5 |
bc096277d9a3e5e1457f75fd39b29ef9
|
|
| BLAKE2b-256 |
2224ee086c313b36cc10b088331ba0eb64d838d349d5fba50235dc08d4a1f35d
|
Provenance
The following attestation bundles were made for wagtail_link_block-1.2.tar.gz:
Publisher:
publish.yml on developersociety/wagtail-link-block
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wagtail_link_block-1.2.tar.gz -
Subject digest:
f0ae53801f46cd90cb9f176ea3af4ae96e0dbb029b6942e1af8561e432219ecd - Sigstore transparency entry: 1185853566
- Sigstore integration time:
-
Permalink:
developersociety/wagtail-link-block@ad9df9cc0f872490d6d0403b85bcace9a5f4de78 -
Branch / Tag:
refs/tags/1.2 - Owner: https://github.com/developersociety
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ad9df9cc0f872490d6d0403b85bcace9a5f4de78 -
Trigger Event:
push
-
Statement type:
File details
Details for the file wagtail_link_block-1.2-py3-none-any.whl.
File metadata
- Download URL: wagtail_link_block-1.2-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1079c0d9839d50be8ae34936c43f024b3f02390623f70dd60cd2a2f74680ab11
|
|
| MD5 |
63fdc7bc5255c526567303ccb26eb669
|
|
| BLAKE2b-256 |
8df612922f4e2d4ea33431e4e328f18257a17d913aa067868fb21c8b7fbf4d49
|
Provenance
The following attestation bundles were made for wagtail_link_block-1.2-py3-none-any.whl:
Publisher:
publish.yml on developersociety/wagtail-link-block
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wagtail_link_block-1.2-py3-none-any.whl -
Subject digest:
1079c0d9839d50be8ae34936c43f024b3f02390623f70dd60cd2a2f74680ab11 - Sigstore transparency entry: 1185853570
- Sigstore integration time:
-
Permalink:
developersociety/wagtail-link-block@ad9df9cc0f872490d6d0403b85bcace9a5f4de78 -
Branch / Tag:
refs/tags/1.2 - Owner: https://github.com/developersociety
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ad9df9cc0f872490d6d0403b85bcace9a5f4de78 -
Trigger Event:
push
-
Statement type: