helmutkaufmann / wn-twigext-plugin

Twig filters and functions extension plugin for WinterCMS. TwigExt allows developers to easily add new Twing funcions and filters to the currently active WinterCMS template.
MIT License
5 stars 3 forks source link

A doubt with the use of redirect Twig tag #1

Closed informas closed 2 years ago

informas commented 2 years ago

Hi, in the example you say that to use redirect Twig tag we must use:

{% redirect('https://mercator.li') %}

I have tried to put it directly on a new page (for example /redir-test) as:

title = "Mercator Redir"
url = "/redir-test"
is_hidden = 0
==
{% redirect('https://mercator.li') %}

and when I want to test it, I have the following error:

Unknown "redirect" tag.

but if instead of using it as in the example, I use it like this (using double { ):

{{ redirect('https://mercator.li') }}

it redirect OK to the destination page without errors.

Could someone explain to me if I'm doing something wrong, if I'm using it incorrectly or if it's just due to an error in the documentation?

Thanks in advance.

helmutkaufmann commented 2 years ago

I think you have not completed your question but you are right, the docu is not correct, please use {{ redirect("your url") }}