Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an to_full_url Antlers modifier #1274

Open
o1y opened this issue Dec 4, 2024 · 0 comments
Open

Provide an to_full_url Antlers modifier #1274

o1y opened this issue Dec 4, 2024 · 0 comments

Comments

@o1y
Copy link

o1y commented Dec 4, 2024

Actually, it's a pretty simple requirement, but I couldn't find a good solution.

I have a link field where the editor can select an entry. Now, I want to use this URL, for example, as the canonical URL of the page. For this, I need to convert the relative URL into an absolute URL.

Currently, I have three options:

  1. Use the join or ensure_left (or other string) modifiers in Antlers to combine the app URL with the entry's URL.
  2. Use the link tag, but this doesn’t work with multi-site setups. For example, {{ link :to="my_link_field" absolute="true" }} will turn /en/test into https://mydomain.test/en/en/test 🫨
  3. Create a custom modifier like{{ my_link_field | to_full_url }}.

Option 3 is what I'm requesting through this idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant