Reputation: 3491
I want to make the urls which I put in the WYSIWYG editor just absolute like /something
but not sitename.com/something
. I know that I can use the "external link" option, but it is not very handy for my editors.
Upvotes: 0
Views: 247
Reputation: 25227
If your rich text fields are outputting full URLs including a domain, it probably means you're hosting multiple sites on the same Wagtail installation. Unfortunately, in this situation it's not possible to override this behaviour to output local URLs.
Wagtail will always prefer to generate local URLs (without a domain) wherever possible, according to the following rules:
In the case of rule 2, the {% pageurl %}
template tag is able to compare the current page against the link destination. However, this isn't possible within the |richtext
template filter: a Django template filter has no access to the calling template's variables, so there's no way for it to know that the current page matches the link destination.
Upvotes: 2