From 6778dfc45f82c940284dc929471039d9c288316b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Charaoui?= Date: Tue, 30 Jul 2024 12:24:13 -0400 Subject: [PATCH] support external URLs in redirect template for tpo/tpa/team#41687 --- models/redirect.ini | 6 ++++++ templates/redirect.html | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/models/redirect.ini b/models/redirect.ini index 8452af9..e3f7232 100644 --- a/models/redirect.ini +++ b/models/redirect.ini @@ -6,6 +6,12 @@ label = Redirect Target type = string description = Target is of type 'string' to allow relative paths. Converted to url in the template. +[fields.external] +label = External URL +type = boolean +description = Target is an external (absolute) URL. +default = false + [fields.key] label = Key type = sort_key diff --git a/templates/redirect.html b/templates/redirect.html index 60560fb..f0db0e4 100644 --- a/templates/redirect.html +++ b/templates/redirect.html @@ -1 +1,5 @@ +{% if this.external -%} + +{%- else -%} +{% endif -%}