In a component, how do I find out the base URI of the forum?

Where do you want to use it?

The Reddit-ish theme, for example, uses discourse/helpers/base-path in the template to create the “the category list” link in the welcome message on the right.

There are also examples where discourse/lib/get-url is used to get the URL in a JavaScript function.

5 Likes