How do I add links to site settings into the settings description of my component?

Actually, I thought I knew because I translated something like <a href="/admin/site_settings/category/all_results?filter=top_menu">top menu site setting</a> several times, and it worked :tada:.
But the tests fail because links without %{base_path} or %{base_url} aren’t allowed.

So I searched for an example and found

I copied that:

<a href="%{base_url}/admin/site_settings/category/all_results?filter=top_menu">top menu site setting</a>

But then the link didn’t work. It became https://example.discourse.group/%%7Bbase_url%7D/admin/site_settings/category/all_results?filter=top_menu

When I installed Homepage Feature, the link there didn’t work either.

So I tried adding a trailing slash and using %{base_url}, but none of them worked.

<a href="/%{base_url}/admin/site_settings/category/all_results?filter=top_menu">top menu site setting</a> links to https://example.discourse.group/admin/customize/themes/%%7Bbase_url%7D/admin/site_settings/category/all_results?filter=top_menu

<a href="%{base_path}/admin/site_settings/category/all_results?filter=top_menu">top menu site setting</a> links to https://example.discourse.group/admin/customize/themes/%%7Bbase_path%7Dadmin/site_settings/category/all_results?filter=top_menu

<a href="/%{base_path}/admin/site_settings/category/all_results?filter=top_menu">top menu site setting</a> links to https://example.discourse.group/%%7Bbase_path%7D/admin/site_settings/category/all_results?filter=top_menu

But I wasn’t able to find a working solution

4 Likes